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-
4- name : Node.js Package
1+ name : Publish Node.js Package
52
63on :
74 push :
85 branches :
96 - master
10- pull_request :
11- branches :
12- - master
13- release :
14- types :
15- - created
167
178jobs :
18- build :
19- runs-on : ubuntu-latest
20- strategy :
21- matrix :
22- node-version : [12.x, 14.x, 16.x]
23-
24- steps :
25- - uses : actions/checkout@v3
26- - name : Use Node.js ${{ matrix.node-version }}
27- - uses : actions/setup-node@v3
28- with :
29- node-version : ${{ matrix.node-version }}
30- cache : ' npm'
31- - run : npm ci
32- - run : npm test
33-
349 publish-npm :
35- needs : build
10+ needs : unit-tests
3611 runs-on : ubuntu-latest
3712 steps :
3813 - uses : actions/checkout@v3
3914 - uses : actions/setup-node@v3
4015 with :
41- node -version : 16.x
42- cache : ' npm'
16+ ode -version : " 16.x"
17+ cache : " npm"
4318 registry-url : https://registry.npmjs.org/
4419 - run : npm ci
4520 - run : npm publish
Original file line number Diff line number Diff line change 1+ name : Test Node.js Package
2+
3+ on :
4+ push :
5+ branches :
6+ - " master"
7+ - " develop"
8+ pull_request :
9+ types : [ready_for_review, synchronize, opened]
10+
11+ jobs :
12+ unit-tests :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v3
16+ - uses : actions/setup-node@v3
17+ with :
18+ node-version : " 16.x"
19+ cache : " npm"
20+ - run : npm ci
21+ - run : npm test
You can’t perform that action at this time.
0 commit comments