-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (72 loc) · 2.1 KB
/
main.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
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: "Main"
"on": "push"
jobs:
node-job:
runs-on: "ubuntu-22.04"
strategy:
matrix:
command:
- "lint"
- "test"
- "build"
steps:
- name: "Checkout repository"
uses: "actions/[email protected]"
- name: "Set up node and yarn"
uses: "actions/[email protected]"
with:
node-version: "20.11.0"
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: "Install node dependencies"
run: "yarn install"
- name: "Run yarn '${{ matrix.command }}'"
run: "yarn run ${{ matrix.command }}"
pre-commit-job:
runs-on: "ubuntu-22.04"
steps:
- name: "Checkout repository"
uses: "actions/[email protected]"
- name: "Set up python and pip cache"
uses: "actions/[email protected]"
with:
python-version: "3.11.4"
cache: "pip"
- name: "Install python dependencies"
run: "pip install -r requirements.txt"
- name: "Set up pre-commit cache"
uses: "actions/[email protected]"
with:
path: "~/.cache/pre-commit"
key: "pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}"
- name: "Run pre-commit"
run: "pre-commit run --all-files --color=always --show-diff-on-failure"
release-job:
needs:
- "pre-commit-job"
- "node-job"
runs-on: "ubuntu-22.04"
permissions:
contents: "write"
issues: "write"
pull-requests: "write"
steps:
- name: "Checkout repository"
uses: "actions/[email protected]"
with:
persist-credentials: false
- name: "Set up node and yarn"
uses: "actions/[email protected]"
with:
node-version: "20.11.0"
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: "Install node dependencies"
run: "yarn install"
- name: "Run semantic-release"
env:
GITHUB_TOKEN: "${{ secrets.SEMANTIC_RELEASE_TOKEN }}"
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
run: "npx semantic-release"
...