-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Update release flow to be more robust #3938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
m-bert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good 😄
Description
Overhaul of the release process:
betaandrcoptions to the previously existingstableandcommitly2.30.0-beta.1when stable2.30.0is published`).Internally:
version-utilsTest plan
Tested on a fork: