Skip to content

Commit beb23b6

Browse files
CopilotmfranzkeCopilotnmerget
authored
refactor: consolidate release.yml into default.yml (#5734)
* Initial plan * refactor: consolidate release.yml into default.yml to eliminate workflow redundancy Co-authored-by: mfranzke <[email protected]> * Add explanatory comment for release concurrency group identifier * fix: moved that comment * Update .github/workflows/default.yml Co-authored-by: Copilot <[email protected]> * Update .github/workflows/default.yml Co-authored-by: Nicolas Merget <[email protected]> * refactor: Simplify screen reader test result checks Removed conditional checks for screen reader test results based on release status. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mfranzke <[email protected]> Co-authored-by: Maximilian Franzke <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Nicolas Merget <[email protected]>
1 parent 45f2708 commit beb23b6

File tree

2 files changed

+45
-299
lines changed

2 files changed

+45
-299
lines changed

.github/workflows/default.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,32 @@ permissions:
55
contents: write
66
actions: write
77
pull-requests: write
8+
id-token: write
89

910
on:
1011
pull_request:
1112
push:
1213
branches:
1314
- "main"
15+
release:
16+
types: [published]
1417

1518
# We'd like to run the pipeline for Dependabot PRs sequentially, and all other PRs in parallel, but still only one action run for each PR.
1619
# TODO: We won't need this anymore as soon as we get Merge Groups and could remove the concurrency again, which currently brings us pain regarding unstarted, non-self-healing dependabot pipelines
20+
# NOTE: Concurrency is disabled for release events as they should always run to completion
1721
concurrency:
22+
# Creates a unique concurrency group identifier for release events using the git reference
1823
group: >-
1924
${{
25+
github.event_name == 'release' &&
26+
format('release-{0}', github.ref) ||
2027
github.actor == 'dependabot[bot]' &&
2128
'dependabot' ||
2229
format('{0}-{1}', github.workflow, github.ref)
2330
}}
2431
cancel-in-progress: >-
2532
${{
33+
github.event_name != 'release' &&
2634
github.actor != 'dependabot[bot]' &&
2735
github.ref != 'refs/heads/main'
2836
}}
@@ -31,13 +39,15 @@ jobs:
3139
init:
3240
uses: ./.github/workflows/00-init.yml
3341
secrets: inherit
42+
with:
43+
release: ${{ github.event_name == 'release' }}
3444

3545
lint:
3646
uses: ./.github/workflows/01-lint-test.yml
3747
needs: [init]
3848

3949
cancel-on-failure-lint:
40-
if: ${{ !cancelled() && needs.lint.result == 'failure' }}
50+
if: ${{ github.event_name != 'release' && !cancelled() && needs.lint.result == 'failure' }}
4151
uses: ./.github/workflows/00-cancel-workflow.yml
4252
secrets: inherit
4353
needs: [lint]
@@ -47,7 +57,7 @@ jobs:
4757
needs: [init]
4858

4959
cancel-on-failure-build-packages:
50-
if: ${{ !cancelled() && needs.build-packages.result == 'failure' }}
60+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-packages.result == 'failure' }}
5161
uses: ./.github/workflows/00-cancel-workflow.yml
5262
secrets: inherit
5363
needs: [build-packages]
@@ -73,7 +83,7 @@ jobs:
7383
needs: [build-packages]
7484

7585
cancel-on-failure-build-outputs:
76-
if: ${{ !cancelled() && needs.build-outputs.result == 'failure' }}
86+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-outputs.result == 'failure' }}
7787
uses: ./.github/workflows/00-cancel-workflow.yml
7888
secrets: inherit
7989
needs: [build-outputs]
@@ -130,7 +140,7 @@ jobs:
130140
showcase: stencil-showcase
131141

132142
cancel-on-failure-build-showcase-stencil:
133-
if: ${{ !cancelled() && needs.build-showcase-stencil.result == 'failure' }}
143+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-stencil.result == 'failure' }}
134144
uses: ./.github/workflows/00-cancel-workflow.yml
135145
secrets: inherit
136146
needs: [build-showcase-stencil]
@@ -143,7 +153,7 @@ jobs:
143153
showcase: angular-showcase
144154

145155
cancel-on-failure-build-showcase-angular:
146-
if: ${{ !cancelled() && needs.build-showcase-angular.result == 'failure' }}
156+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-angular.result == 'failure' }}
147157
uses: ./.github/workflows/00-cancel-workflow.yml
148158
secrets: inherit
149159
needs: [build-showcase-angular]
@@ -156,7 +166,7 @@ jobs:
156166
showcase: angular-ssr-showcase
157167

158168
cancel-on-failure-build-showcase-angular-ssr:
159-
if: ${{ !cancelled() && needs.build-showcase-angular-ssr.result == 'failure' }}
169+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-angular-ssr.result == 'failure' }}
160170
uses: ./.github/workflows/00-cancel-workflow.yml
161171
secrets: inherit
162172
needs: [build-showcase-angular-ssr]
@@ -169,7 +179,7 @@ jobs:
169179
showcase: react-showcase
170180

171181
cancel-on-failure-build-showcase-react:
172-
if: ${{ !cancelled() && needs.build-showcase-react.result == 'failure' }}
182+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-react.result == 'failure' }}
173183
uses: ./.github/workflows/00-cancel-workflow.yml
174184
secrets: inherit
175185
needs: [build-showcase-react]
@@ -182,7 +192,7 @@ jobs:
182192
showcase: next-showcase
183193

184194
cancel-on-failure-build-showcase-next:
185-
if: ${{ !cancelled() && needs.build-showcase-next.result == 'failure' }}
195+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-next.result == 'failure' }}
186196
uses: ./.github/workflows/00-cancel-workflow.yml
187197
secrets: inherit
188198
needs: [build-showcase-next]
@@ -195,7 +205,7 @@ jobs:
195205
showcase: vue-showcase
196206

197207
cancel-on-failure-build-showcase-vue:
198-
if: ${{ !cancelled() && needs.build-showcase-vue.result == 'failure' }}
208+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-vue.result == 'failure' }}
199209
uses: ./.github/workflows/00-cancel-workflow.yml
200210
secrets: inherit
201211
needs: [build-showcase-vue]
@@ -208,7 +218,7 @@ jobs:
208218
showcase: nuxt-showcase
209219

210220
cancel-on-failure-build-showcase-nuxt:
211-
if: ${{ !cancelled() && needs.build-showcase-nuxt.result == 'failure' }}
221+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-nuxt.result == 'failure' }}
212222
uses: ./.github/workflows/00-cancel-workflow.yml
213223
secrets: inherit
214224
needs: [build-showcase-nuxt]
@@ -221,7 +231,7 @@ jobs:
221231
secrets: inherit
222232

223233
cancel-on-failure-build-showcase-patternhub:
224-
if: ${{ !cancelled() && needs.build-showcase-patternhub.result == 'failure' }}
234+
if: ${{ github.event_name != 'release' && !cancelled() && needs.build-showcase-patternhub.result == 'failure' }}
225235
uses: ./.github/workflows/00-cancel-workflow.yml
226236
secrets: inherit
227237
needs: [build-showcase-patternhub]
@@ -266,23 +276,23 @@ jobs:
266276
baseUrl: ${{ needs.init.outputs.baseUrl }}
267277

268278
regenerate-snapshots-components:
269-
if: ${{ !cancelled() && needs.test-components.result == 'failure' }}
279+
if: ${{ github.event_name != 'release' && !cancelled() && needs.test-components.result == 'failure' }}
270280
uses: ./.github/workflows/02-e2e-regenerate.yml
271281
with:
272282
version: ${{ needs.init.outputs.playwrightVersion }}
273283
type: components
274284
needs: [test-components, init]
275285

276286
regenerate-snapshots-foundations:
277-
if: ${{ !cancelled() && needs.test-foundations.result == 'failure' }}
287+
if: ${{ github.event_name != 'release' && !cancelled() && needs.test-foundations.result == 'failure' }}
278288
uses: ./.github/workflows/02-e2e-regenerate.yml
279289
with:
280290
version: ${{ needs.init.outputs.playwrightVersion }}
281291
type: foundations
282292
needs: [test-foundations, init]
283293

284294
regenerate-snapshots-patternhub:
285-
if: ${{ !cancelled() && needs.test-showcase-patternhub.result == 'failure' }}
295+
if: ${{ github.event_name != 'release' && !cancelled() && needs.test-showcase-patternhub.result == 'failure' }}
286296
uses: ./.github/workflows/02-e2e-regenerate.yml
287297
with:
288298
version: ${{ needs.init.outputs.playwrightVersion }}
@@ -291,8 +301,10 @@ jobs:
291301
needs: [build-showcase-patternhub, test-showcase-patternhub, init]
292302

293303
# This job runs only if aria-snapshots were changed compared to main or if it runs on main branch
304+
# For releases, it always runs
294305
test-screen-reader:
295306
if: |
307+
github.event_name == 'release' ||
296308
needs.init.outputs.test-ally == 'true' ||
297309
github.event.pull_request == null
298310
uses: ./.github/workflows/02-e2e-screen-reader.yml
@@ -302,7 +314,7 @@ jobs:
302314

303315
regenerate-snapshots:
304316
if: |
305-
!cancelled() && !contains(github.actor,'[bot]') && (
317+
github.event_name != 'release' && !cancelled() && !contains(github.actor,'[bot]') && (
306318
needs.test-showcase-angular.result == 'failure' ||
307319
needs.test-showcase-react.result == 'failure' ||
308320
needs.test-showcase-vue.result == 'failure' ||
@@ -325,7 +337,7 @@ jobs:
325337
uses: ./.github/workflows/02-e2e-regenerated-snapshots-commit.yml
326338
secrets: inherit
327339
if: |
328-
${{ !cancelled() &&
340+
${{ github.event_name != 'release' && !cancelled() &&
329341
( needs.regenerate-snapshots-components.result == 'success' ||
330342
needs.regenerate-snapshots-foundations.result == 'success' ||
331343
needs.regenerate-snapshots-patternhub.result == 'success' ||
@@ -349,6 +361,8 @@ jobs:
349361
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
350362
steps:
351363
- name: 🎉 Checks done
364+
env:
365+
IS_RELEASE: ${{ github.event_name == 'release' }}
352366
run: |
353367
resultBuildStorybookComposition="${{ needs.build-storybook-composition.result }}"
354368
resultBuildStorybookAngular="${{ needs.build-storybook-angular.result }}"
@@ -371,12 +385,13 @@ jobs:
371385
resultTestShowcaseVue="${{ needs.test-showcase-vue.result }}"
372386
resultTestShowcasePatternhub="${{ needs.test-showcase-patternhub.result }}"
373387
resultTestScreenReader="${{ needs.test-screen-reader.result }}"
388+
374389
if [[ $resultBuildStorybookComposition == "success" ]] && \
375390
[[ $resultBuildStorybookAngular == "success" ]] && \
376391
[[ $resultBuildStorybookReact == "success" ]] && \
377392
[[ $resultBuildStorybookVue == "success" ]] && \
378393
[[ $resultTestFoundations == "success" ]] && \
379-
[[ $resultTestScreenReader == "success" || $resultTestScreenReader == "skipped" ]] && \
394+
[[ $resultTestScreenReader == "success" || (github.event_name != 'release' && $resultTestScreenReader == "skipped") ]] && \
380395
[[ $resultTestShowcaseStencil == "success" ]] && \
381396
[[ $resultTestShowcaseAngular == "success" ]] && \
382397
[[ $resultTestShowcaseReact == "success" ]] && \
@@ -428,12 +443,12 @@ jobs:
428443
if: |
429444
${{
430445
!cancelled() && github.actor != 'dependabot[bot]' &&
431-
(github.event.pull_request == null || github.event.pull_request.head.repo.owner.login == 'db-ux-design-system')
446+
(github.event_name == 'release' || github.event.pull_request == null || github.event.pull_request.head.repo.owner.login == 'db-ux-design-system')
432447
}}
433448
needs: [checks-done, init]
434449
with:
435-
release: false
436-
preRelease: false
450+
release: ${{ needs.init.outputs.release }}
451+
preRelease: ${{ needs.init.outputs.preRelease }}
437452
name: ${{ needs.init.outputs.branchName }}
438453
repoName: ${{ needs.init.outputs.repoName }}
439454
repoOwner: ${{ needs.init.outputs.repoOwner }}
@@ -442,3 +457,13 @@ jobs:
442457
if: ${{ !cancelled() && github.event.pull_request != null }}
443458
needs: [deploy]
444459
uses: ./.github/workflows/03-preview-url-pr-description.yml
460+
461+
publishpackages:
462+
if: ${{ github.event_name == 'release' }}
463+
uses: ./.github/workflows/03-publish-packages.yml
464+
needs: [init, checks-done, build-outputs]
465+
secrets: inherit
466+
with:
467+
release: ${{ needs.init.outputs.release }}
468+
preRelease: ${{ needs.init.outputs.preRelease }}
469+
version: ${{ needs.init.outputs.version }}

0 commit comments

Comments
 (0)