-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (66 loc) · 1.87 KB
/
test.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
63
64
65
66
67
68
69
70
71
72
# This workflow will do a clean install of node dependencies, build the source code and and then publish a package to npm when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Test and Publish
env:
NODE_VERSION: 18.x
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: yarn
- run: yarn lint
- run: yarn build
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: yarn build-icons
- run: yarn test
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use golang 1.20
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
- name: install addlicense
run: go install github.com/google/addlicense@latest
- name: check license
run: npm run check-license
publish:
runs-on: ubuntu-latest
needs: [build]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ secrets.MIA_NPM_REGISTRY_URL }}
- run: yarn install --frozen-lockfile
- run: yarn build
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: yarn build-icons
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.MIA_NPM_REGISTRY_TOKEN }}