fix(ci/release-ts): npm publish --tag for prereleases#228
Merged
Conversation
Surfaced by the v0.2.0-rc.1 dry-run: npm refuses to publish a prerelease without an explicit dist-tag, because otherwise the prerelease would silently inherit the `latest` tag and `npm install pgque` would resolve to it for every user. Resolve the dist-tag from the version's prerelease identifier: 0.2.0 -> latest 0.2.0-rc.1 -> rc 0.2.0-dev.0 -> dev 0.2.0-beta.3 -> beta 0.2.0-alpha.1 -> alpha 0.2.0-anything -> next (catch-all) Apply in both the validate-stage `npm publish --dry-run --provenance` and the gated `npm publish --provenance` step. Caught by the post-#225 dry-run that ran end-to-end for the first time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Surfaced by the v0.2.0-rc.1 dry-run, which is the first time the TypeScript release workflow has run end-to-end (it was env-gated until #222). The prerelease publish failed at the dry-run step:
```
npm error You must specify a tag using --tag when publishing a prerelease version.
```
This is real even outside dry-run: without an explicit `--tag`, npm would assign the prerelease the default `latest` dist-tag, and `npm install pgque` would resolve to a prerelease for every user.
Fix
Resolve the dist-tag from the version's prerelease identifier in both publish steps (validate-stage `npm publish --dry-run --provenance` and gated `npm publish --provenance`):
Final releases (no prerelease component) get `latest` as before. Prereleases never inherit `latest`.
Validation
Related
🤖 Generated with Claude Code