-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
85 lines (70 loc) · 3.58 KB
/
Copy pathjustfile
File metadata and controls
85 lines (70 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package-jsons := "packages/css-var-kit/package.json \
packages/vscode/package.json \
packages/cli-darwin-arm64/package.json \
packages/cli-darwin-x64/package.json \
packages/cli-linux-arm64/package.json \
packages/cli-linux-x64/package.json \
packages/cli-win32-x64/package.json"
zed-pkg := "crates/zed-extension"
# Bumps the version on a release branch cut from the latest main and opens its PR; merging it releases.
# Without `level`, bumpp prompts for it. `body-file` becomes the PR body, and `bumpp-args` go to bumpp.
bump-version level="" body-file="/dev/null" *bumpp-args: (_readable body-file) _latest-main
#!/usr/bin/env sh
set -eu
pnpm bumpp {{package-jsons}} --no-commit --no-tag --no-push {{ if level == "" { "" } else { "--release " + level } }} {{bumpp-args}}
version=$(node -p "require('./packages/css-var-kit/package.json').version")
cargo set-version --workspace "$version"
just sync-optional-deps
pnpm install --lockfile-only
cargo generate-lockfile
# bumpp only picks the version; the branch is named after it, so it is cut afterwards.
git switch -c "chore/release-$version"
git add packages/*/package.json Cargo.toml Cargo.lock crates/*/Cargo.toml pnpm-lock.yaml
git commit -m "chore: release v$version"
git push -u origin HEAD
gh pr create --fill --body-file {{quote(body-file)}} --label skip-changelog
# Bumps the Zed extension version on a release branch cut from the latest main and opens its PR; merging it tags the release.
bump-zed-version level: _latest-main
#!/usr/bin/env sh
set -eu
(cd {{zed-pkg}} && cargo set-version --bump {{level}})
version=$(cd {{zed-pkg}} && cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
sed -i.bak "s/^version = \".*\"/version = \"$version\"/" {{zed-pkg}}/extension.toml
rm {{zed-pkg}}/extension.toml.bak
(cd {{zed-pkg}} && cargo generate-lockfile)
tombi format {{zed-pkg}}/Cargo.toml {{zed-pkg}}/extension.toml {{zed-pkg}}/Cargo.lock
git switch -c "chore/release-zed-$version"
git add {{zed-pkg}}/Cargo.toml {{zed-pkg}}/extension.toml {{zed-pkg}}/Cargo.lock
git commit -m "chore(zed): release v$version"
git push -u origin HEAD
gh pr create --fill --label skip-changelog
# Checked before anything changes, so a missing file stops the release there.
[private]
_readable path:
@[ -r {{quote(path)}} ] || { echo '{{path}} is not readable'; exit 1; }
[private]
_latest-main:
#!/usr/bin/env sh
set -eu
git diff --quiet HEAD -- || { echo 'tracked files differ from HEAD; commit them first'; exit 1; }
git switch main
git pull --ff-only
sync-optional-deps:
@node -e "\
const fs = require('fs');\
const p = './packages/css-var-kit/package.json';\
const pkg = JSON.parse(fs.readFileSync(p, 'utf8'));\
for (const k of Object.keys(pkg.optionalDependencies || {})) {\
pkg.optionalDependencies[k] = pkg.version;\
}\
fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');\
"
gen-value-kinds: gen-value-kind-set gen-value-kind-doc gen-value-kind-schema
gen-value-kind-set:
@pnpm node scripts/gen-value-kind-set/main.ts crates/css-var-kit/generated/value_kind_set.rs
@rustfmt crates/css-var-kit/generated/value_kind_set.rs
gen-value-kind-doc:
@pnpm node scripts/gen-value-kind-set/main.ts --gen-doc docs/VALUE_KINDS.md
@pnpm oxfmt docs/VALUE_KINDS.md
gen-value-kind-schema:
@pnpm node scripts/gen-value-kind-set/main.ts --gen-schema packages/css-var-kit/value-kinds.schema.json