Skip to content

Commit 8cea776

Browse files
fix: enhance publish workflow to support prerelease tagging
1 parent f8b63cf commit 8cea776

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish Package to npmjs
22
on:
33
release:
4-
types: [published]
4+
types: [published, prereleased]
55
jobs:
66
build:
77
permissions:
@@ -29,6 +29,13 @@ jobs:
2929
run: pnpm run build
3030

3131
- name: Publish to npm
32-
run: pnpm publish --access public --no-git-checks
32+
run: |
33+
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
34+
echo "Publishing as beta (pre-release)..."
35+
pnpm publish --tag beta --access public --no-git-checks
36+
else
37+
echo "Publishing as normal release..."
38+
pnpm publish --access public --no-git-checks
39+
fi
3340
env:
3441
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)