-
-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (121 loc) · 5.64 KB
/
semantic-release.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
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
142
143
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Semantic Release"
on: # yamllint disable-line rule:truthy
push:
branches:
- "([0-9])?(.{+([0-9]),x}).x"
- "main"
- "next"
- "next-major"
- "alpha"
- "beta"
permissions:
contents: "read" # for checkout
jobs:
semantic-release:
name: "Semantic Release"
runs-on: "ubuntu-latest"
permissions:
contents: "write" # to be able to publish a GitHub release
issues: "write" # to be able to comment on released issues
pull-requests: "write" # to be able to comment on released pull requests
id-token: "write" # to enable use of OIDC for npm provenance
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895" # v2.6.1
with:
egress-policy: "audit"
- name: "Wait for tests to succeed"
uses: "lewagon/wait-on-check-action@595dabb3acf442d47e29c9ec9ba44db0c6bdd18f" # v1.3.3
timeout-minutes: 20
with:
ref: "${{ github.event.pull_request.head.sha || github.sha }}"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
wait-interval: 60 # seconds
running-workflow-name: "Semantic Release" # wait for all other checks to complete
allowed-conclusions: "success,skipped" # all other checks must pass, being skipped or cancelled is not sufficient
- name: "Git checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
fetch-depth: 0
persist-credentials: false
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
- uses: "pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598" # v2.4.0
with:
version: 8
run_install: false
- name: "Use Node.js 20.x"
uses: "actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8" # v4.0.1
with:
node-version: "20.6.1"
cache: "pnpm"
# @see: npm install -g npm@latest is necessary to make provenance available. More info: https://docs.npmjs.com/generating-provenance-statements
- name: "Upgrade npm to latest version"
run: "npm install --global [email protected]"
env:
SKIP_CHECK: "true"
- name: "Check npm version"
run: "npm -v"
env:
SKIP_CHECK: "true"
- name: "Install packages"
run: "pnpm install --frozen-lockfile"
env:
SKIP_BUILD: "true"
- name: "Verify the integrity of provenance attestations and registry signatures for installed dependencies"
run: "npm audit signatures"
- name: "Build Production"
run: "pnpm run build:prod:packages"
- name: "npm v8.5+ requires workspaces-update to be set to false"
run: "echo 'workspaces-update=false' >> .npmrc"
- name: "Semantic Release"
if: "success()"
env:
GITHUB_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}"
NPM_TOKEN: "${{ secrets.NPM_AUTH_TOKEN }}"
GIT_AUTHOR_NAME: "github-actions-shell"
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
GIT_COMMITTER_NAME: "github-actions-shell"
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
run: "pnpm exec multi-semantic-release"
pnpm-lock-update:
needs: "semantic-release"
name: "pnpm-lock.yaml update"
runs-on: "ubuntu-latest"
permissions:
contents: "write" # to be able to publish
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895" # v2.6.1
with:
egress-policy: "audit"
- name: "Git checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
fetch-depth: 2
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
- uses: "pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598" # v2.4.0
with:
version: 8
- name: "Use Node.js 20.x"
uses: "actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8" # v4.0.1
with:
node-version: "20.6.1"
- name: "Update pnpm lock"
run: "pnpm install --no-frozen-lockfile"
env:
SKIP_BUILD: "true"
- name: "Commit modified files"
uses: "stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d" # v5.0.0
with:
commit_message: "chore: updated pnpm-lock.yaml"
commit_author: "prisis <[email protected]>"
commit_user_email: "[email protected]"
commit_user_name: "prisis"
branch: "${{ github.head_ref }}"