Repository navigation
chore: pass the release version through and infer the npm tag - #5149
Merged
Merged
Conversation
The release script ran `release-it --only-version`. release-it 13.7.2 has no such option and parses only --dry-run and --ci as boolean flags, so `yarn release 6.0.0-alpha.1` took the version as the flag's value and released the recommended bump instead: 6.0.0. .release-it.json pinned npm.tag to "alpha" and github.preRelease to true. A configured tag always wins, so every release, 6.0.0 included, would go to the alpha tag as a GitHub prerelease and leave 5.15.3 on latest. - Run plain `release-it`, so the version passed is the version released. - Drop npm.tag and github.preRelease: release-it takes the tag from the prerelease id (alpha, beta, rc) or uses latest for a stable version, and marks prereleases on GitHub by itself. - Create the GitHub release as a draft, so the example app pipeline (which runs when a release is published) waits until npm has the package. - Rewrite "Publishing a release" in CONTRIBUTING.md to match.
|
Found potential problems with the pull request:
|
JKobrynski
approved these changes
Oct 29, 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.
Motivation
Today
yarn release 6.0.0-alpha.1publishes 6.0.0 under thealphanpm tag. Two things combine:package.jsonrunsrelease-it --only-version. release-it 13.7.2 (the version inyarn.lock) has no--only-versionoption and parses only--dry-runand--cias boolean flags, so the version you type becomes that flag's value and is dropped. release-it then applies the recommended bump, which is major: 6.0.0-alpha.0 becomes 6.0.0..release-it.jsonpinsnpm.tagtoalphaandgithub.preReleasetotrue. A configured tag always wins, so beta, rc and 6.0.0 itself would all go toalphaas GitHub prereleases, andlatestwould stay on 5.15.3.npm never accepts the same version twice, so one wrong run would burn 6.0.0. This blocks the next prerelease, 6.0.0-alpha.1.
Changes
package.json: the release script is plainrelease-it, so the version you pass is the version released..release-it.json: nonpm.tagand nogithub.preRelease. release-it takes the npm tag from the prerelease id (alpha,beta,rc), useslatestfor a stable version, and marks prereleases on GitHub by itself.github.draft: truecreates the GitHub release as a draft, sopublish-example-app.yml(which runs onrelease: published) waits until npm has the package.CONTRIBUTING.md: "Publishing a release" now says to always pass the version, start with a dry run, be logged in to npm (npm whoami, elsenpm login), and publish the draft release once npm has the package.Test plan
Dry runs with release-it 13.7.2 on
mainateb4fcbe, with--npm.skipChecks --github.skipChecksand nothing published:yarn release 6.0.0-alpha.1 --dry-runnpm publish --tag alpha--tag alphayarn release 6.0.0-beta.0 --dry-run--tag alpha--tag betayarn release 6.0.0 --dry-run--tag alpha--tag latestWith the new config, the GitHub release for 6.0.0-alpha.1 is a draft prerelease and the one for 6.0.0 a draft regular release.
The
5.0branch is not affected: its release script is already plainrelease-itand it sets no npm tag. Before any 5.x release after 6.0.0 it will need"tag": "5.x", in a separate PR to5.0.