chore(release): split update-version.sh into bump and tag scripts#23
Open
rqbazan wants to merge 1 commit into
Open
chore(release): split update-version.sh into bump and tag scripts#23rqbazan wants to merge 1 commit into
rqbazan wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update-version.shto do the pre-merge half of a release: bumppackage.json+ regeneratedist/+ createrelease/v<x.y.z>branch + open PR. Takes the target version as a positional arg (./update-version.sh 1.3.0).tag-release.shfor the post-merge half: verifies thatmainalready has the expected version, creates the fixedv<x.y.z>tag and force-moves thev1moving tag, pushes both.Why
The org-level
quality-gateruleset blocks direct pushes tomain, so the prior monolithic script always fails atgit push origin main. The first attempt at the v1.2.0 release exercised this — the push was rejected, andset -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 tomaingo through a PR, tags don't need one.Other small UX improvements:
package.json(no more "editpackage.jsonfirst, then run script" gotcha).main, clean tree, in sync withorigin/main) and run withset -euo pipefail.tag-release.shverifies thatpackage.jsononmainmatches the expected version before tagging — guards against forgetting to merge the PR or pullmain.Test plan
bash -n update-version.sh(syntax OK)bash -n tag-release.sh(syntax OK)🤖 Generated with Claude Code