Skip to content

Commit de10c80

Browse files
authored
Merge pull request #1159 from jescalada/update-npm-release-workflow
chore: update npm release workflow to handle pre-releases
2 parents dea031d + 6943b1d commit de10c80

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/npm.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ jobs:
2424
- run: npm run build
2525
env:
2626
IS_PUBLISHING: 'YES'
27-
- run: npm publish --access=public
27+
28+
- name: Check if pre-release and publish to NPM
29+
run: |
30+
VERSION=$(node -p "require('./package.json').version")
31+
if [[ "$VERSION" == *"-"* ]]; then
32+
echo "Publishing pre-release: $VERSION"
33+
npm publish --access=public --tag rc
34+
else
35+
echo "Publishing stable release: $VERSION"
36+
npm publish --access=public
37+
fi
2838
env:
2939
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)