feat(scripts): support stable and tagged (prerelease) version releases - #85
Open
GOODBOY008 wants to merge 3 commits into
Open
feat(scripts): support stable and tagged (prerelease) version releases#85GOODBOY008 wants to merge 3 commits into
GOODBOY008 wants to merge 3 commits into
Conversation
Add 'prerelease [identifier]' and 'stable' bump types to bump-version.mjs so both stable (vX.Y.Z) and tagged prerelease (vX.Y.Z-<id>.<n>) releases can be driven from the npm scripts. Prerelease/stable bumps rename the CHANGELOG section for the same release line instead of inserting duplicate sections. Adds version:prerelease / version:stable npm scripts and unit tests.
…tags The upload-updater-json and update-homebrew jobs only skipped tags containing 'alpha' or 'beta', so an rc tag (vX.Y.Z-rc.N) slipped through and would have replaced the stable latest.json / cask with a prerelease. Skip any tag with a dash (stable tags are always vX.Y.Z) so tagged prereleases never hijack the stable updater channel.
The release-version skill now covers both release kinds end-to-end: stable releases (vX.Y.Z, published with --latest, drives the in-app updater + Homebrew) and tagged prerelease releases (vX.Y.Z-<id>.<n>, published with --prerelease, never Latest). Also documents the prerelease bump types, CHANGELOG section handling, and verification steps.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support in R-Shell’s release tooling for tagged prereleases (e.g. v2.8.0-beta.1, v2.8.0-rc.1) and finalizing to stable (e.g. v2.8.0), covering version math, CHANGELOG handling, npm scripts, workflow safety-guards, and documentation.
Changes:
- Refactors
scripts/bump-version.mjsto export pure semver utilities, addprerelease [identifier]+stablebump types, and adjust CHANGELOG section behavior for prerelease lines. - Adds/updates
pnpmscripts and docs to expose the new bump commands and explain stable vs prerelease release flow. - Hardens
release.ymlgating so any dashed tag (vX.Y.Z-*) cannot update stable channels (latest.json, Homebrew).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/bump-version.mjs |
Implements prerelease/stable bumping, exports version math, and updates CHANGELOG logic. |
src/__tests__/bump-version.test.ts |
Adds unit tests for version transitions and CHANGELOG section behavior. |
package.json |
Adds version:prerelease and version:stable scripts. |
.github/workflows/release.yml |
Ensures stable-channel updater/Homebrew jobs only run for non-dashed tags. |
.github/skills/release-version/SKILL.md |
Documents stable vs tagged prerelease release procedure and verification. |
scripts/README.md |
Documents new bump commands and prerelease behavior. |
README.md |
Updates version bumping examples to include prerelease/stable flows. |
AGENTS.md |
Updates contributor-facing version bumping guidance for prerelease/stable. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+141
to
+146
| function renameSection(changelog, fromVersion, toVersion, date) { | ||
| return changelog.replace( | ||
| new RegExp(`^## \\[${escapeRegex(fromVersion)}\\]`, 'm'), | ||
| `## [${toVersion}] - ${date}` | ||
| ); | ||
| } |
Comment on lines
+16
to
+18
| pnpm run version:prerelease # stable -> 2.8.0-beta.1, or 2.8.0-beta.1 -> 2.8.0-beta.2 | ||
| pnpm run version:prerelease rc # continue/switch the prerelease line (alpha|beta|rc|...) | ||
| pnpm run version:stable # finalize a prerelease -> stable (2.8.0-beta.3 -> 2.8.0) |
Comment on lines
+287
to
+289
| pnpm run version:prerelease # 2.2.0 → 2.3.0-beta.1, or 2.3.0-beta.1 → 2.3.0-beta.2 (tagged) | ||
| pnpm run version:prerelease rc # 2.3.0-beta.3 → 2.3.0-rc.1 (switch prerelease line) | ||
| pnpm run version:stable # 2.3.0-beta.3 → 2.3.0 (finalize to stable) |
Comment on lines
+110
to
+112
| pnpm run version:prerelease # 0.7.1 → 0.8.0-beta.1, or 0.8.0-beta.1 → 0.8.0-beta.2 (tagged) | ||
| pnpm run version:prerelease rc # 0.8.0-beta.3 → 0.8.0-rc.1 (switch prerelease line) | ||
| pnpm run version:stable # 0.8.0-beta.3 → 0.8.0 (finalize to stable) |
Comment on lines
+56
to
+60
| pnpm run version:patch # 2.7.0 -> 2.7.1 (stable) | ||
| pnpm run version:minor # 2.7.0 -> 2.8.0 (stable) | ||
| pnpm run version:prerelease # 2.7.0 -> 2.8.0-beta.1 (tagged) | ||
| pnpm run version:prerelease rc # 2.8.0-beta.3 -> 2.8.0-rc.1 (tagged) | ||
| pnpm run version:stable # 2.8.0-beta.3 -> 2.8.0 (finalize) |
Comment on lines
+148
to
+169
| function insertSection(changelog, version, date) { | ||
| const newSection = ` | ||
| ## [${version}] - ${date} | ||
|
|
||
| ### Added | ||
|
|
||
| - _Add new features here_ | ||
|
|
||
| ### Changed | ||
|
|
||
| - _Add changes here_ | ||
|
|
||
| ### Fixed | ||
|
|
||
| - _Add bug fixes here_ | ||
| `; | ||
| // Insert after the Unreleased section | ||
| return changelog.replace( | ||
| /(## \[Unreleased\][^\n]*\n\n[^\n]*\n\n)/, | ||
| `$1${newSection}\n` | ||
| ); | ||
| } |
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.
What
Makes stable (
v2.8.0) and tagged (v2.8.0-beta.1,v2.8.0-rc.1) releases first-class in the r-shell release tooling, end to end.Changes
scripts/bump-version.mjs— newprerelease [identifier]andstablebump types alongside the existing stablemajor/minor/patch:prereleasefrom stable opens the next minor line:2.7.0 → 2.8.0-beta.1prereleasecontinues the line (2.8.0-beta.1 → 2.8.0-beta.2) or switches identifier at.1(2.8.0-beta.3 → 2.8.0-rc.1)stablefinalizes a prerelease to its base (2.8.0-beta.3 → 2.8.0)split('.')broke on prerelease suffixes)package.json—version:prereleaseandversion:stablenpm scripts..github/workflows/release.yml—upload-updater-jsonandupdate-homebrewonly skipped tags containingalpha/beta, so an rc tag (v2.8.0-rc.1) would have replaced the stablelatest.json/ Homebrew cask with a prerelease. They now skip any tag with a dash (stable tags are alwaysvX.Y.Z), so tagged prereleases can never hijack the stable updater channel..github/skills/release-version/SKILL.md— documents both release kinds: stable (--latest, drives in-app updater + Homebrew) vs tagged prerelease (--prerelease, never Latest), including tag naming, CHANGELOG handling, and per-kind verification.Docs —
AGENTS.md,README.md,scripts/README.mdupdated with the new commands.Tests
src/__tests__/bump-version.test.ts) for version transitions and CHANGELOG section handlingNotes
The prior
b1f6cd5branch tip was content-identical to the already-merged #82, so the branch was rebased ontoorigin/main(that commit auto-skipped) and re-created here with three focused commits.