Repository navigation
ci(publish): derive npm dist-tag from package version - #18
Merged
MatiasOS merged 2 commits intoSep 15, 2026
Merged
Conversation
npm 11 refuses to publish a prerelease without an explicit --tag, and JS-DevTools/npm-publish only passes --tag when its tag input is set, so every alpha release failed in CI. Publish X.Y.Z-<preid>.N under <preid> (e.g. alpha), numeric preids under next, and stable versions under latest.
Use the git+https form that npm auto-corrects to on publish.
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.
Fixes the npm publish workflow, which fails for every prerelease. The latest failure is run 34886797034, after #17 bumped the version to
1.3.0-alpha.0:Cause
The workflow runs Node 24, which ships npm 11. npm 11 won't publish a prerelease unless a tag is set explicitly.
JS-DevTools/npm-publish@v4only passes--tagwhen itstaginput is set, and the workflow doesn't set one.Every alpha from
1.1.0-alpha.0to1.2.1-alpha.0failed in CI and was published by hand.1.0.0and1.0.1were published by this workflow through trusted publishing (OIDC), so auth works and the missing tag is the only blocker.Changes
.github/workflows/npm-publish.ymldist-tagstep readsversionfrompackage.jsonand passes the tag to the actionpackage.jsonrepository.url→git+https://github.com/openscan-explorer/explorer-metadata.git, the form npm was auto-correcting to (removes the publish warning)Tag mapping
1.3.0-alpha.0alpha1.3.0-beta.2beta2.0.0-rc.1rc1.0.2-0next1.3.0latestThis matches the tags already on npm (
latest: 1.0.1,alpha: 1.2.1-alpha.0). A numeric prerelease id, which is whatnpm version prereleasegives without--preid, falls back tonextbecause npm rejects0as a tag. The tag isn't hardcoded toalpha, so a stable release still moveslatest.Testing
dist-tagstep as written in the workflow file against the currentpackage.json: it outputstag=alpha.npm publish --dry-run(npm 11.6.0) reproduces the CI error.npm publish --dry-run --tag alphapublishes1.3.0-alpha.0underalphawith no warnings.npm run validate,npm run formatandnpm run lintpass.After merge
The push to
mainshould publish1.3.0-alpha.0underalpha. It isn't on npm yet, so that run is the real test; please don't publish it by hand before then, or the workflow will skip it.npm view @openscan/metadata dist-tags # expect alpha: 1.3.0-alpha.0, latest: 1.0.1