Skip to content

Commit 13608af

Browse files
holdenliangcursoragent
andcommitted
ci: publish prerelease versions with npm beta dist-tag
Detect semver prerelease (version containing '-') and publish with --tag beta so beta builds do not overwrite latest. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b87716c commit 13608af

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# bound to this repository and this workflow file (publish.yml).
66
#
77
# Trigger: only when a v* tag is pushed.
8+
# Dist-tag: stable versions → latest; prerelease (e.g. 4.0.3-beta.1) → beta.
89
name: Publish Package to npmjs
910

1011
on:
@@ -35,4 +36,13 @@ jobs:
3536
npm --version
3637
3738
- name: Publish to npm with provenance
38-
run: npm publish --provenance --access public
39+
run: |
40+
VERSION=$(node -p "require('./package.json').version")
41+
echo "Publishing version: $VERSION"
42+
if [[ "$VERSION" == *-* ]]; then
43+
echo "Prerelease detected → npm dist-tag: beta"
44+
npm publish --provenance --access public --tag beta
45+
else
46+
echo "Stable release → npm dist-tag: latest"
47+
npm publish --provenance --access public
48+
fi

0 commit comments

Comments
 (0)