File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
41name : Node.js Package
52
63on :
74 release :
85 types : [created]
96
107jobs :
11- build :
8+ build-linux-x64 :
129 runs-on : ubuntu-latest
1310 steps :
1411 - uses : actions/checkout@v2
1512 - uses : actions/setup-node@v2
13+ with : node-version: 14
14+ - run : npm install
15+ - run : npm run prebuild
16+ - uses : actions/upload-artifact@v2
1617 with :
17- node-version : 14
18- - run : npm ci
19- - run : npm test
20-
21- publish-npm :
22- needs : build
23- runs-on : ubuntu-latest
18+ name : linux-x64
19+ path : prebuilds/linux-x64/
20+ build-win32-x64 :
21+ runs-on : windows-latest
2422 steps :
2523 - uses : actions/checkout@v2
2624 - uses : actions/setup-node@v2
25+ with : node-version: 14
26+ - run : npm install
27+ - run : npm run prebuild
28+ - uses : actions/upload-artifact@v2
2729 with :
28- node-version : 14
29- registry-url : https://registry.npmjs.org/
30- - run : npm ci
31- - run : npm publish
32- env :
33- NODE_AUTH_TOKEN : ${{secrets.npm_token}}
34-
35- publish-gpr :
36- needs : build
30+ name : win32-x64
31+ path : prebuilds/win32-x64/
32+ publish-npm :
3733 runs-on : ubuntu-latest
38- permissions :
39- contents : read
40- packages : write
34+ needs : [build-linux-x64, build-win32-x64]
4135 steps :
4236 - uses : actions/checkout@v2
4337 - uses : actions/setup-node@v2
4438 with :
4539 node-version : 14
46- registry-url : https://npm.pkg.github.com/
47- - run : npm ci
40+ registry-url : https://registry.npmjs.org/
41+ - uses : actions/download-artifact@v2
42+ with :
43+ name : linux-x64
44+ path : prebuilds/
45+ - uses : actions/download-artifact@v2
46+ with :
47+ name : win32-x64
48+ path : prebuilds/
49+ - run : npm install
4850 - run : npm publish
4951 env :
50- NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN }}
52+ NODE_AUTH_TOKEN : ${{ secrets.npm_token }}
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ node_modules/
22node-addon-api /
33build /
44test /test_linux
5- test /test_win.exe
5+ test /test_win.exe
6+ prebuilds /
You can’t perform that action at this time.
0 commit comments