File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,39 +2,36 @@ name: Publish Node.js package
22
33on :
44 release :
5- types : [created]
5+ types : [ created ]
66 workflow_dispatch :
77
88env :
99 NODE_ENV : production
10+ NODE_VERSION : ' 10.x'
1011
1112jobs :
12- build-npmjs :
13+ build-and-publish :
14+ name : Build and publish Node.js package
1315 runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ packages : write
1419 steps :
1520 - uses : actions/checkout@v3
1621 - name : Set up publishing to npmjs.com
1722 uses : actions/setup-node@v3
1823 with :
19- node-version : ' 10.x '
24+ node-version : ${{ env.NODE_VERSION }}
2025 registry-url : ' https://registry.npmjs.org'
2126 - run : npm ci
2227 - run : npm publish
2328 env :
2429 NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
25- build-github-packages :
26- runs-on : ubuntu-latest
27- permissions :
28- contents : read
29- packages : write
30- steps :
31- - uses : actions/checkout@v3
3230 - name : Set up publishing to GitHub Packages
3331 uses : actions/setup-node@v3
3432 with :
35- node-version : ' 10.x '
33+ node-version : ${{ env.NODE_VERSION }}
3634 registry-url : ' https://npm.pkg.github.com'
37- - run : npm ci
3835 - run : npm publish
3936 env :
4037 NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments