-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (45 loc) · 1.29 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
name: Check, Build & Publish Package
on:
push:
branches: [main]
pull_request:
branches: '*'
jobs:
check-and-build:
runs-on: ${{ matrix.os }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Install, check, test, and build using Node.js ${{ matrix.node-version }} ⚙️
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn lint
- run: yarn pretty
- run: yarn test
- run: yarn build
publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [check-and-build]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Deploy and Publish package using Node.js ${{ matrix.node-version }} 🚀
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn build
- run: yarn release