Skip to content

Conversation

@j-piasecki
Copy link
Member

Description

Overhaul of the release process:

  • adds beta and rc options to the previously existing stable and commitly
  • allows the release of a specific version, independent from the branch name (optional, will still detect the version from the branch name when unspecified)
  • verifies that the latest version is either one patch, one minor, or one major higher than the currently published version (ATM throws on major change)
  • verifies that beta, rc and commitly releases aren't done for an already published version (i.e. will disallow publishing 2.30.0-beta.1 when stable 2.30.0 is published`).
  • automatic numbering of beta and rc releases

Internally:

  • moved most of the helpers to separate files
  • moved version numbering helpers to version-utils
  • added tests covering the release scripts

Test plan

Tested on a fork:

Copilot AI review requested due to automatic review settings January 29, 2026 12:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Overhauls the npm release automation to support additional release channels (beta/rc), optional explicit version publishing, and stronger validation around what can be published and tagged.

Changes:

  • Add release helpers for computing next stable/pre-release versions and validating latest vs non-latest publishes.
  • Refactor release scripting by extracting argument parsing and version computation into dedicated modules.
  • Add Jest-based unit tests for the release scripts and introduce a CI workflow to run them.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
yarn.lock Adds Jest dependency to lockfile for running new script tests.
package.json Adds test script and Jest dev dependency for running release-script tests.
scripts/release/version-utils.js Adds helpers to compute latest/next stable/pre-release versions using npm registry queries.
scripts/release/validate-non-latest-version.js Adds validation to prevent publishing non-latest releases when the base version already exists.
scripts/release/validate-latest-version.js Adds validation to ensure latest-tagged stable releases increment semver correctly.
scripts/release/should-be-latest.js Expands logic for deciding whether a stable release should be tagged as latest.
scripts/release/set-package-version.js Refactors to use shared argument parsing + version selection helpers.
scripts/release/parse-arguments.js Introduces centralized CLI flag parsing for release scripts.
scripts/release/get-version.js Implements version selection logic per release type (stable/beta/rc/commitly).
scripts/release/tests/version-utils.test.js Adds unit tests for version parsing and next-version helpers.
scripts/release/tests/validate-non-latest-version.test.js Adds unit tests for non-latest publish validation logic.
scripts/release/tests/validate-latest-version.test.js Adds unit tests for latest publish validation logic.
scripts/release/tests/should-be-latest.test.js Adds unit tests for npm-tag selection logic.
scripts/release/tests/parse-arguments.test.js Adds unit tests for release CLI argument parsing.
scripts/release/tests/get-version.test.js Adds unit tests for deriving versions for each release type.
.github/workflows/run-jest-tests.yml Adds a CI workflow to run the new Jest tests.
.github/workflows/publish-release.yml Extends publish workflow to support manual stable/beta/rc and automatic commitly releases.
.github/actions/publish-npm-package/action.yml Updates composite action to accept release type/version, determine npm tag, and validate versions before publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j-piasecki j-piasecki marked this pull request as ready for review January 29, 2026 14:08
Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

Overall looks good 😄

@j-piasecki j-piasecki merged commit 84218f7 into main Feb 4, 2026
2 checks passed
@j-piasecki j-piasecki deleted the update-release-flow branch February 4, 2026 12:05
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.

3 participants