-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 1.73 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
permissions:
contents: read
jobs:
check:
name: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run linter
run: npm run lint
- name: Run type checking
run: npm run check
- name: Verify CSP hashes
run: |
npm run generate:csp-script-hashes
if [ -n "$(git status --porcelain)" ]; then
echo "CSP hashes are not up to date. Please run 'npm run generate:csp-script-hashes' locally and commit the changes."
git diff
exit 1
fi
release:
name: release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [check]
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Create release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}