From 1050a7e32a34c1992edcf26a5054cc70a7ac33e9 Mon Sep 17 00:00:00 2001 From: Joichiro Hayashi Date: Fri, 25 Sep 2026 09:05:03 +0900 Subject: [PATCH] chore(release): take the release PR body as a file in bump-version - `just bump-version notes.md` opens the release PR with the file as its body, which starts the GitHub release notes - Pass the arguments after the file to bumpp, so `--yes` skips the prompts - Document the release steps in .claude/CLAUDE.md --- .claude/CLAUDE.md | 12 ++++++++++++ justfile | 13 +++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 6b3e602..9260dc3 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -9,3 +9,15 @@ - Leverage the lightningcss or cssparser crates, and avoid custom implementations for logic as much as possible. - Avoid redundant comments; instead, convey your intent through symbol naming. Write comments only when the logic becomes complex. + +# Releasing + +1. Write the release notes for users, not reviewers, in a file outside the repo. +2. Run `just bump-version notes.md --yes`, where `` is the release type I give, such + as `patch`. It pushes a release branch and opens its PR with the file as the body. Arguments after + the file go to bumpp. +3. I merge the PR. The release workflow tags the merge commit, publishes the packages, and creates + the GitHub release. The notes start with the PR body, followed by the PRs merged since the last + tag. + +Step 2 pushes and opens a PR. Run it only on my explicit go-ahead. diff --git a/justfile b/justfile index 789fa5f..144753d 100644 --- a/justfile +++ b/justfile @@ -9,12 +9,12 @@ package-jsons := "packages/css-var-kit/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. -bump-version level="": _latest-main +# 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 } }} + 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" @@ -27,7 +27,7 @@ bump-version level="": _latest-main 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 --label skip-changelog + 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 @@ -47,6 +47,11 @@ bump-zed-version level: _latest-main 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