File tree Expand file tree Collapse file tree 2 files changed +76
-0
lines changed
Expand file tree Collapse file tree 2 files changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to NPM
2+
3+ on :
4+ release :
5+ types : [released]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - uses : actions/setup-node@v3
13+ with :
14+ node-version : ' 18.x'
15+ registry-url : ' https://registry.npmjs.org'
16+
17+ - name : Install dependencies
18+ run : npm ci
19+
20+ - name : Build
21+ run : npm run build
22+
23+ - name : Run tests
24+ run : npm test -- --no-watch
25+
26+ publish-npm :
27+ needs : build
28+ runs-on : ubuntu-latest
29+ steps :
30+ - uses : actions/checkout@v3
31+ - uses : actions/setup-node@v3
32+ with :
33+ node-version : ' 18.x'
34+ registry-url : ' https://registry.npmjs.org'
35+
36+ - name : Install dependencies
37+ run : npm ci
38+
39+ - name : Build
40+ run : npm run build
41+
42+ - name : Publish to NPM
43+ run : npm publish
44+ env :
45+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 1+ name : Unit Tests
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ push :
7+ branches : [ main ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+
15+ - name : Setup Node.js
16+ uses : actions/setup-node@v3
17+ with :
18+ node-version : ' 18.x'
19+ cache : ' npm'
20+
21+ - name : Install dependencies
22+ run : npm ci
23+
24+ - name : Run linting
25+ run : npm run lint
26+
27+ - name : Run unit tests
28+ run : npm test -- --no-watch
29+
30+ - name : Build
31+ run : npm run build
You can’t perform that action at this time.
0 commit comments