ci: automate release — version-bump PR, draft release, and dist-tag sync#2256
Merged
Conversation
- Add "Create Release PR" workflow_dispatch: bumps all package versions (lerna fixed mode) and opens a Release X.Y.Z PR. Inputs choose the bump type (pre* = beta channel, plain = latest) and preid. - Add Draft Release workflow: on merge of a "Release ..." PR, auto-create a draft GitHub Release with the v-tag, pre-release flag for betas, and generated notes. Publishing stays a manual human gate. - release.yml now derives the npm dist-tag (beta vs latest) from the version instead of defaulting everything to latest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep release.yml as-is; this PR only adds the Create Release PR button and the Draft Release automation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the bump-type dropdown + preid with a single 'version' text input. You type the exact target (e.g. 1.32.0-beta.5); the run summary shows current -> new. Validates semver format before touching files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitHub can't compute versions in a workflow_dispatch form, so bake them in: add scripts/gen-release-options.mjs which rewrites the choice options as "<bump>: <current> -> <target>". The workflow runs it after bumping and commits the refreshed dropdown into the Release PR, so master's form always reflects the latest version. The bump step parses the target from the choice. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d59ff45 to
3f27d84
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72d73d7 to
c4c4b3b
Compare
Drop the self-editing dropdown generator (scripts/gen-release-options.mjs). GitHub workflow_dispatch dropdowns are static and can't show computed values, and editing the workflow file in the release PR was both blocked for GITHUB_TOKEN and wrong for a release PR. Instead, the dropdown is a simple bump-type picker and the bump step computes the target from the current version at run time via semver. add-paths scopes the PR to version files only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…un time) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A release sets each package's publishConfig.tag (the npm dist-tag used by `lerna publish from-package`) to `beta` for prereleases and `latest` for stable. Fold it into `yarn bump-version` (chained after lerna) so it applies locally, and mirror it in the Create Release PR workflow after its lerna call. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitHub can't render computed values in workflow_dispatch dropdowns, so show a fixed generic example per option (e.g. 1.2.3 -> 1.3.0). The bump step parses the leading keyword; the actual resulting version still shows in the summary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ninadbstack
approved these changes
Jun 2, 2026
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
Automates the manual release chore behind a button, keeping humans on the two real gates (merge + publish). No npm publish happens automatically — the existing
release.yml(unchanged) still runs only when you publish a GitHub Release.version-bump.yml(new) — "Create Release PR" buttonManually triggered from the Actions tab. You pick how to bump from a dropdown (each option carries a fixed, illustrative example):
publishConfig.tagto match:betafor prereleases,latestfor stable.Release X.Y.ZPR that touches onlylerna.json+packages/**/package.json— never workflow files (so the defaultGITHUB_TOKENworks; no PAT needed).draft-release.yml(new) — auto draft on mergeWhen a
Release …PR merges tomaster, creates a draft GitHub Release:v<version>tag,--prereleaseflag for betas,--generate-notes. You just click Publish to ship. Skips if the tag's release already exists.package.json—bump-versionalso syncs the tagyarn bump-versionnow runslerna version …then setspublishConfig.tagto match the result, so local bumps stay correct too.lernaremains the direct command (tag-sync chained after it).Flow
Required repo settings
GITHUB_TOKENdon't trigger CI (test.yml/lint.yml). If CI on the Release PR is desired, add aRELEASE_PATsecret and switch thetoken:inversion-bump.yml. (Release PRs are version-only, so this is optional.)Testing
Verified end-to-end on a fork (pranavz28/cli):
Release X.Y.ZPR touching only version files (0 workflow files).patch) and latest → beta (prerelease) flip both the version andpublishConfig.tagacross all 18 publishable packages.🤖 Generated with Claude Code