-
-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (48 loc) · 1.3 KB
/
main.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
name: Test & Publish
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
with:
persist-credentials: false
- name: Setup 🔧
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Install ♻
run: npm install
- name: Lint 👓
run: npm run lint
- name: Test ✅
run: npm run test
publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
with:
persist-credentials: false
- name: Check Version Changes ↗
uses: EndBug/[email protected]
id: check
- name: Setup 🔧
if: steps.check.outputs.changed == 'true'
uses: actions/[email protected]
with:
node-version: 12
registry-url: https://registry.npmjs.org
- name: Install ♻
if: steps.check.outputs.changed == 'true'
run: npm install
- name: Publish 🚀
if: steps.check.outputs.changed == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}