-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (49 loc) · 1.36 KB
/
build.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
name: build
on:
- push
jobs:
build:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: d4844aaf-4533-4d72-80df-65806ecb6591
NPM_AUTH_TOKEN: ${{ secrets.QMBOT_NPM_TOKEN }}
strategy:
matrix:
node-version: [16.x, 18.x]
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install packages
run: yarn
- name: run linter
run: yarn lint
- name: build bundles
run: yarn build
- name: run tests
run: yarn test
- name: upload coverage
run: bash <(curl -s https://codecov.io/bash)
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.QMBOT_NPM_TOKEN }}
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@master
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- name: install packages
run: yarn
- name: build bundles
run: yarn build
- name: publish to npm
run: make publish