-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1005 Bytes
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Publish to NPM
on:
release:
types: [published]
jobs:
test:
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
matrix:
node: ["12.x", "14.x", "16.x", "17.x"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Installing node ${{matrix.node}} on ${{matrix.os}}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
cache: "npm"
- run: npm ci
- run: npm test
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Installing node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
cache: "npm"
- run: npm ci
- name: Building...
run: npm run build
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}