Skip to content

chore(release): split update-version.sh into bump and tag scripts#23

Open
rqbazan wants to merge 1 commit into
mainfrom
chore/release-scripts
Open

chore(release): split update-version.sh into bump and tag scripts#23
rqbazan wants to merge 1 commit into
mainfrom
chore/release-scripts

Conversation

@rqbazan

@rqbazan rqbazan commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrites update-version.sh to do the pre-merge half of a release: bump package.json + regenerate dist/ + create release/v<x.y.z> branch + open PR. Takes the target version as a positional arg (./update-version.sh 1.3.0).
  • Adds tag-release.sh for the post-merge half: verifies that main already has the expected version, creates the fixed v<x.y.z> tag and force-moves the v1 moving tag, pushes both.
  • Documents the two-step flow in README under "Releasing".

Why

The org-level quality-gate ruleset blocks direct pushes to main, so the prior monolithic script always fails at git push origin main. The first attempt at the v1.2.0 release exercised this — the push was rejected, and set -euo pipefail (added in #21) prevented the script from continuing on to create tags pointing at a commit that was never published. The new shape matches what the ruleset enforces: changes to main go through a PR, tags don't need one.

Other small UX improvements:

  • Version is a positional arg instead of being read from package.json (no more "edit package.json first, then run script" gotcha).
  • Both scripts have pre-flight checks (on main, clean tree, in sync with origin/main) and run with set -euo pipefail.
  • tag-release.sh verifies that package.json on main matches the expected version before tagging — guards against forgetting to merge the PR or pull main.

Test plan

  • bash -n update-version.sh (syntax OK)
  • bash -n tag-release.sh (syntax OK)
  • First real exercise will be the next release (≥ v1.3.0) — flagging this so reviewers know.

🤖 Generated with Claude Code

The org-level quality-gate ruleset blocks direct pushes to main, which
made the prior update-version.sh always fail at `git push origin main`.
Split the flow into two scripts that match the new constraint:

- update-version.sh <version>: bump package.json + regenerate dist +
  create release/v<x.y.z> branch + open PR. Version comes from a
  positional argument (more cohesive than the previous "edit
  package.json first, then run script" UX).
- tag-release.sh <version>: post-merge step. Verifies main matches
  the expected version, creates the fixed v<x.y.z> tag and force-moves
  the v1 moving tag, pushes both. Tags are not under the ruleset so
  they can still be pushed directly.

Both scripts share pre-flight checks (on main, clean tree, in sync
with origin) and run with set -euo pipefail.

README gets a "Releasing" section documenting the two-step flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant