Skip to content

feat(scripts): support stable and tagged (prerelease) version releases - #85

Open
GOODBOY008 wants to merge 3 commits into
mainfrom
docs/release-version-skill
Open

feat(scripts): support stable and tagged (prerelease) version releases#85
GOODBOY008 wants to merge 3 commits into
mainfrom
docs/release-version-skill

Conversation

@GOODBOY008

Copy link
Copy Markdown
Owner

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 — new prerelease [identifier] and stable bump types alongside the existing stable major/minor/patch:

  • prerelease from stable opens the next minor line: 2.7.0 → 2.8.0-beta.1
  • prerelease continues 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)
  • stable finalizes a prerelease to its base (2.8.0-beta.3 → 2.8.0)
  • Robust semver parsing (the old split('.') broke on prerelease suffixes)
  • Prerelease/stable bumps rename the CHANGELOG section for the same release line instead of inserting duplicates, so draft notes carry over
  • Pure version math is exported and unit-tested

package.jsonversion:prerelease and version:stable npm scripts.

.github/workflows/release.ymlupload-updater-json and update-homebrew only skipped tags containing alpha/beta, so an rc tag (v2.8.0-rc.1) would have replaced the stable latest.json / Homebrew cask with a prerelease. They now skip any tag with a dash (stable tags are always vX.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.

DocsAGENTS.md, README.md, scripts/README.md updated with the new commands.

Tests

  • 29 new unit tests (src/__tests__/bump-version.test.ts) for version transitions and CHANGELOG section handling
  • Full suite green: 594 passed

Notes

The prior b1f6cd5 branch tip was content-identical to the already-merged #82, so the branch was rebased onto origin/main (that commit auto-skipped) and re-created here with three focused commits.

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.
Copilot AI lite review requested due to automatic review settings August 11, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mjs to export pure semver utilities, add prerelease [identifier] + stable bump types, and adjust CHANGELOG section behavior for prerelease lines.
  • Adds/updates pnpm scripts and docs to expose the new bump commands and explain stable vs prerelease release flow.
  • Hardens release.yml gating 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 thread scripts/bump-version.mjs
Comment on lines +141 to +146
function renameSection(changelog, fromVersion, toVersion, date) {
return changelog.replace(
new RegExp(`^## \\[${escapeRegex(fromVersion)}\\]`, 'm'),
`## [${toVersion}] - ${date}`
);
}
Comment thread scripts/README.md
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 thread README.md
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 thread AGENTS.md
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 thread scripts/bump-version.mjs
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`
);
}
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.

2 participants