File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ name: Publish Package
33on :
44 push :
55 branches :
6- - main # Triggers on pushes to the main branch
6+ - main # Triggers on pushes to the main branch
77 # tags:
8- # - 'v*.*.*' # Triggers on tag pushes matching the pattern
8+ # - 'v*.*.*' # Uncomment this if you want to trigger on version tags
99
1010jobs :
1111 build-and-publish :
@@ -26,11 +26,18 @@ jobs:
2626 - name : Run tests
2727 run : npm test
2828
29- # If you have a build step, include it; otherwise, you can remove this step
30- # - name: Build the package
31- # run: npm run build
29+ - name : Determine publish tag
30+ id : determine_tag
31+ run : |
32+ VERSION=$(node -p "require('./package.json').version")
33+ echo "Package version is $VERSION"
34+ if [[ "$VERSION" == *"-beta"* ]]; then
35+ echo "publish_tag=beta" >> $GITHUB_ENV
36+ else
37+ echo "publish_tag=latest" >> $GITHUB_ENV
38+ fi
3239
3340 - name : Publish to npm
34- run : npm publish
41+ run : npm publish --tag ${{ env.publish_tag }}
3542 env :
3643 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 11{
22 "name" : " nextjs-centralized-error-handler" ,
3- "version" : " 1.0.15 -beta.1" ,
3+ "version" : " 1.0.16 -beta.1" ,
44 "main" : " src/index.js" ,
55 "scripts" : {
66 "test" : " jest" ,
You can’t perform that action at this time.
0 commit comments