-
Notifications
You must be signed in to change notification settings - Fork 6
fix(ci): set npm dist-tag for prereleases #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,18 @@ jobs: | |
| } | ||
| const registry = "https://registry.npmjs.org"; | ||
|
|
||
| const prereleaseId = version.match( | ||
| /^[^-]+-([0-9A-Za-z-]+)(?:[.+]|$)/, | ||
| )?.[1]; | ||
| let npmTag = "latest"; | ||
| if (prereleaseId === "alpha" || prereleaseId === "rc") { | ||
| npmTag = prereleaseId; | ||
| } else if (prereleaseId) { | ||
| npmTag = "next"; | ||
| } | ||
|
|
||
| console.log(`Publishing ${version} with npm dist-tag ${npmTag}.`); | ||
|
|
||
| const wait = (ms) => | ||
| new Promise((resolve) => { | ||
| setTimeout(resolve, ms); | ||
|
|
@@ -195,6 +207,8 @@ jobs: | |
| workspacePackage.dir, | ||
| "--access", | ||
| "public", | ||
| "--tag", | ||
| npmTag, | ||
|
Comment on lines
+210
to
+211
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a manual dispatch or GitHub release targets an unpublished stable version lower than one already in the registry, explicitly passing Useful? React with 👍 / 👎. |
||
| "--registry", | ||
| registry, | ||
| ], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: afx-team/evjs
Length of output: 4722
Exclude build metadata when selecting the npm dist-tag.
1.0.0+build-alphais a stable SemVer version, but the current regex matchesalphaand publishes it with thealphatag. Parse only the prerelease portion, not build metadata after+, and add a regression case for1.0.0+build-alphawith expected taglatest.Suggested fix
🤖 Prompt for AI Agents
Source: MCP tools