-
Notifications
You must be signed in to change notification settings - Fork 7
141 lines (133 loc) · 6.49 KB
/
main.yml
File metadata and controls
141 lines (133 loc) · 6.49 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Main Push
on:
push:
branches:
- main
- beta
permissions:
contents: read
jobs:
Install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
Test:
needs:
- Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm run test
Lint:
needs:
- Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm run lint
Typecheck:
needs:
- Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm run typecheck
Build:
needs:
- Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm run build
Release:
# Prevent infinite release loop
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release)') }}
permissions:
contents: write
issues: write
pull-requests: write
needs:
- Lint
- Typecheck
- Build
- Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
with:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # https://github.com/actions/setup-node/releases/tag/v6.4.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # https://github.com/actions/cache/releases/tag/v5.0.5
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
GIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
GIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
GIT_GIT_COMMITTER_NAME_NAME: ${{ github.event.head_commit.committer.name }}
GIT_GIT_COMMITTER_NAME_EMAIL: ${{ github.event.head_commit.committer.email }}