File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 11name : Publish npm package
2-
32on :
43 release :
54 types : [created]
65 workflow_dispatch :
7-
6+ inputs :
7+ prerelease :
8+ description : ' Publish as prerelease (adds --tag next)'
9+ required : false
10+ type : boolean
11+ default : false
812env :
913 rootDir : ./packages/nextjs-cache-handler
10-
1114jobs :
1215 publish-npm :
1316 runs-on : ubuntu-latest
14-
1517 defaults :
1618 run :
1719 working-directory : ${{ env.rootDir }}
1820 steps :
1921 - name : Checkout code
2022 uses : actions/checkout@v4
21-
2223 - name : Copy README file to package directory
2324 run : |
2425 cp ../../README.md .
25-
2626 - uses : actions/setup-node@v4
2727 with :
2828 cache : npm
2929 node-version : lts/*
3030 cache-dependency-path : ${{ env.rootDir }}/package-lock.json
3131 registry-url : " https://registry.npmjs.org"
3232 - run : npm ci
33- - run : npm publish --access public
33+ - name : Publish to npm
34+ run : |
35+ if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
36+ npm publish --access public --tag next
37+ else
38+ npm publish --access public
39+ fi
3440 env :
3541 NODE_AUTH_TOKEN : ${{secrets.npm_token}}
You can’t perform that action at this time.
0 commit comments