File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ name: Publish Package
22
33on :
44 release :
5- types : [created]
5+ types : [published]
6+ workflow_dispatch :
7+ push :
8+ tags :
9+ - ' v*'
610
711jobs :
812 build :
3236
3337 - name : Publish to NPM
3438 working-directory : ./package
35- run : npm publish
39+ run : |
40+ VER=$(node -p "require('./package.json').version")
41+ if echo "$VER" | grep -q '-'; then
42+ echo "Detected prerelease version $VER -> publishing with tag 'next'"
43+ npm publish --tag next --access public
44+ else
45+ echo "Publishing stable version $VER"
46+ npm publish --access public
47+ fi
3648 env :
3749 NODE_AUTH_TOKEN : ${{ secrets.SHNIPPET_NPM_TOKEN }}
Original file line number Diff line number Diff line change 11{
22 "name" : " shnippet" ,
33 "type" : " module" ,
4- "version" : " 0.1.1 -alpha.0" ,
4+ "version" : " 1.0.0 -alpha.0" ,
55 "description" : " A snippet extraction tool for various programming languages." ,
66 "main" : " ./dist/index.cjs" ,
77 "module" : " ./dist/index.js" ,
You can’t perform that action at this time.
0 commit comments