-
-
Notifications
You must be signed in to change notification settings - Fork 56
71 lines (71 loc) · 2.09 KB
/
default.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
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: "16"
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["14", "16", "18"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn test
passed:
name: All CI passed
runs-on: ubuntu-latest
needs:
- lint
- test
if: always()
steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
env:
RESULT_JSON: ${{ toJSON(needs) }}
with:
script: |
const result = JSON.parse(process.env.RESULT_JSON);
const passed = Object.values(result).every(({ result }) => result === 'success');
if (!passed) process.exit(1);
release:
name: Release package
if: github.ref == 'refs/heads/main'
needs:
- passed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ssh-key: ${{ secrets.DEPLOY_GIT_SSH_PRIVATE_KEY }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: "16"
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn patch-package
- run: yarn build
- run: yarn run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}