Skip to content

fix(ci/release-ts): npm publish --tag for prereleases#228

Merged
NikolayS merged 1 commit intomainfrom
fix/npm-publish-tag-prerelease
May 7, 2026
Merged

fix(ci/release-ts): npm publish --tag for prereleases#228
NikolayS merged 1 commit intomainfrom
fix/npm-publish-tag-prerelease

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

@NikolayS NikolayS commented May 7, 2026

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`):

Version Resolved `--tag`
`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-` `next`

Final releases (no prerelease component) get `latest` as before. Prereleases never inherit `latest`.

Validation

  • `actionlint` clean.
  • Tag resolution logic verified locally against all 6 representative inputs above.
  • Plan to re-dispatch `Release TypeScript client` with version=`0.2.0-rc.1` and dry_run=true after merge; expected `resolved npm dist-tag: rc` followed by clean `npm publish --dry-run --tag rc`.

Related

🤖 Generated with Claude Code

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>
@NikolayS NikolayS merged commit b4baa6d into main May 7, 2026
12 checks passed
@NikolayS NikolayS deleted the fix/npm-publish-tag-prerelease branch May 7, 2026 04:15
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.

1 participant