-
-
Notifications
You must be signed in to change notification settings - Fork 113
257 lines (230 loc) · 8.47 KB
/
Copy pathci.yml
File metadata and controls
257 lines (230 loc) · 8.47 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: "CI"
on:
push:
tags:
- "*"
pull_request:
concurrency:
group: ${{ github.event.pull_request.number }}-ci
cancel-in-progress: true
jobs:
build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 100
fetch-tags: true
- name: Set Node.js 24.x
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.x
- name: Install NPM
run: |
npm ci
- name: Audit NPM
run: |
npm audit --audit-level=high
- name: Build
run: npm run build && npm run format && npm run lint && npm run package
- name: Test
run: npm run test-github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'junit.xml'
comment: true
detailed_summary: true
commit-dist:
needs: build
if: |
github.event_name == 'pull_request' &&
startsWith(github.head_ref, 'renovate/') &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.actor == github.repository_owner || github.actor == 'renovate-mike[bot]')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.x
- run: npm ci && npm run build && npm run package
- name: Commit rebuilt dist
run: |
git config user.name "Mike Penz"
git config user.email "opensource-bot@mikepenz.dev"
git add dist/
git diff --staged --quiet || git commit -m "chore: rebuild dist for renovate"
git push https://x-access-token:${{ secrets.RENOVATE_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.event.pull_request.head.ref }}
test:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# the below actions use the local state of the action. please replace `./` with `mikepenz/release-changelog-builder-action@{latest-release}`
# Showcases how to use the action without a prior checkout
# Since 3.2.0 the configuration can be provided within the `yml` file
- name: "Configuration without Checkout"
id: without_checkout
uses: mikepenz/release-changelog-builder-action@a77ddc56cd841de54a1fc5bdcf1c0c5eebe9ae52 # develop
with:
toTag: "v3.1.1"
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
}
]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Configuration without Checkout Changelog
env:
CHANGELOG: ${{ steps.without_checkout.outputs.changelog }}
run: echo "CHANGELOG"
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
# Showcase the most minimal configuration possible
- name: "Minimal Configuration"
id: minimal_release
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Minimal Configuration Changelog
env:
CHANGELOG: ${{ steps.minimal_release.outputs.changelog }}
run: echo "$CHANGELOG"
# Showcases a more complex configuration, providing a configuration, and specifically referencing owner, repo, from and to tag
- name: "Complex Configuration"
id: complex_release
uses: ./
with:
configuration: "configs/configuration_complex.json"
owner: "mikepenz"
repo: "release-changelog-builder-action"
fromTag: "v0.0.1"
toTag: "v0.0.3"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Complex Configuration Changelog
env:
CHANGELOG: ${{ steps.complex_release.outputs.changelog }}
run: echo "CHANGELOG"
# Showcases the capability to generate the changelog for an external repository provided
# Showcase ability to only fetch data first, and then continue with exported data later
- name: "External Repo Configuration Collect Report"
id: external_changelog_collect
uses: ./
with:
owner: "mikepenz"
repo: "MaterialDrawer"
fromTag: "v8.1.0"
toTag: "v8.1.6"
token: ${{ secrets.PERSONAL_TOKEN }}
exportCache: true
exportOnly: true
- name: "External Repo Configuration"
id: external_changelog
uses: ./
with:
configuration: "configs/configuration_complex.json"
owner: "mikepenz"
repo: "MaterialDrawer"
cache: ${{ steps.external_changelog_collect.outputs.cache }}
- name: "External Repo Configuration Second"
id: external_changelog_second
uses: ./
with:
configurationJson: |
{
"template": "#{{CHANGELOG}}",
"pr_template": "PR: ##{{NUMBER}}",
"categories": [
{
"title": "## Everything",
"labels": []
}
]
}
owner: "mikepenz"
repo: "MaterialDrawer"
cache: ${{ steps.external_changelog_collect.outputs.cache }}
- name: Echo External Repo Configuration Changelog
env:
CHANGELOG: ${{ steps.external_changelog.outputs.changelog }}
CHANGELOG_SECOND: ${{ steps.external_changelog_second.outputs.changelog }}
run: |
echo "First:"
echo "$CHANGELOG"
echo "Second:"
echo "$CHANGELOG_SECOND"
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Set Node.js 24.x
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.x
- name: Build
run: npm ci && npm audit --audit-level=high && npm run build && npm run package
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@bcae7115752d4ed746ff92feb666574428a79415 # v6.2.1
with:
configuration: "configs/configuration_repo.json"
ignorePreReleases: ${{ !contains(github.ref, '-') }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: mikepenz/action-gh-release@2a00e201320fb618d8e705a736286b2e31aa48e2 # v3.0.0
with:
body: ${{steps.github_release.outputs.changelog}}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Attest build provenance
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: dist/index.js