-
-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (58 loc) · 1.49 KB
/
nodejs.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Node CI
on: [push]
jobs:
tests:
name: Test on node ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-optional
env:
CI: true
- name: Lint
run: yarn lint
env:
CI: true
- name: Test
run: yarn test
- name: Build
run: yarn build
env:
CI: true
publish:
name: Publish to NPM
runs-on: ubuntu-latest
needs:
- tests
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org
- name: install global module
run: |
npm install -g yarn
if: contains(github.ref, 'tags/v')
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-optional
if: contains(github.ref, 'tags/v')
env:
CI: true
- name: Build
run: yarn build
if: contains(github.ref, 'tags/v')
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
if: contains(github.ref, 'tags/v')