Land the release commit on main via an auto-merged PR - #560
Conversation
A direct push of the release commit is rejected by the branch ruleset
("N of N required status checks are expected"), so the script built every
artifact and then failed at publish, leaving a local-only tag.
The commit now goes through a release-X.Y.Z branch and a PR that GitHub
auto-merges once the same required checks pass. The tag is cut after that
merge rather than before: a squash or rebase merge rewrites the commit SHA,
and a tag cut earlier would point at a commit that is not in main. The PR is
merged with --merge for the same reason. Every stage is idempotent, so a
re-run after a failure resumes instead of duplicating.
Also gate the GitHub release step on --no-push. It was unguarded, so
--no-push still created or clobbered the live release, which made the script
impossible to dry-run.
|
Verified against the live repo: this flow cannot arm auto-merge today.
Reproduced just now on two unrelated PRs (#563, #564), so it is a repository setting, not a per-PR state. As written, Two ways out: enable "Allow auto-merge" in repository settings (Settings -> General -> Pull Requests) and this works as designed, or fall back to polling the required checks and issuing a plain |
Fixes the publish path in
scripts/release.sh. Hit while cutting 0.2.105.Problem
Step 4 pushed the release commit directly to
main. The branch ruleset rejects that:So the script cross-compiled all four targets, then died at publish — leaving a version bump, a commit, and a
vX.Y.Ztag that existed only locally, with nothing on GitHub. v0.2.104 shipped as PR #548 from arelease-0.2.104branch, so the PR route was already the de facto process; the script just didn't know it.Change
release-X.Y.Zbranch and a PR that GitHub auto-merges once the same required checks pass. Reuses an already-open PR on a re-run.main. The PR is merged with--mergefor the same reason, and the script assertsmainis actually at the new version before tagging.release.sh X.Y.Z | tail -40) reports the pipe's exit code and makes a failed release read as success.Also fixed
--no-pushdid not gate the GitHub release step, so a "dry run" still created or clobbered the live release. That's why this couldn't be dry-run tested before. Now gated.Verification
bash -nclean;shellcheck -S warningreports only the two pre-existing SC2115 warnings in the build block../scripts/release.sh 0.2.105 --no-push --skip-tapexits 0, skips every stage correctly, and leaves no side effects.main. First real test is 0.2.106.Refs CL-6957.