fix(release): resolve npm dist-tag from prerelease label#3
Merged
Conversation
Previously release.yml ran 'npm publish --access public --provenance' with no --tag flag, so every publish (including prereleases like 0.2.0-alpha.2) defaulted to 'latest'. That overrode the alpha dist-tag and meant 'npm install @datacline/langos-sdk-node' would pull a pre-release. Now we resolve the dist-tag from the version: 0.2.0-alpha.2 -> alpha 0.2.0-beta.1 -> beta 0.2.0-rc.0 -> rc 1.0.0 -> latest Prereleases stay on their own channel; default install only pulls a prerelease if the user explicitly asks (npm install @scope/pkg@alpha).
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.
Summary
release.ymlpublished0.2.0-alpha.2without--tag, so it landed onlatestinstead ofalpha. That overrode the alpha channel —npm install @datacline/langos-sdk-node(with no version) would now pull a pre-release.Fix
Resolve the dist-tag from the prerelease label in
package.jsonversion:0.2.0-alpha.2alpha0.2.0-beta.1beta0.2.0-rc.0rc1.0.0latestPrereleases stay on their own channel; default install only pulls a prerelease if the user explicitly asks (
npm install @datacline/langos-sdk-node@alpha).Already-fixed state
The current dist-tags were corrected manually post-publish via
npm dist-tag add @datacline/langos-sdk-node@0.2.0-alpha.2 alpha. Registry now reads{ alpha: '0.2.0-alpha.2', latest: '0.2.0-alpha.2' }(latest stays at alpha.2 until first stable).Test plan
0.2.0-alpha.2→alpha,1.0.0→latest,0.2.0→latest