Repository navigation
160 lines (143 loc) · 4.33 KB
/
Copy pathrelease.yml
File metadata and controls
160 lines (143 loc) · 4.33 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
move-tags:
default: false
description: Allow tags to be moved? Requires GitHub Release.
required: false
type: boolean
publish-github-release:
default: false
description: Create a GitHub release?
required: false
type: boolean
release-tag:
default: latest
description: Floating release tag to use.
type: string
required: true
concurrency:
group: release
cancel-in-progress: false
env:
# renovate: datasource=node-version depName=node versioning=node
NODE_VERSION: "24.14.0"
jobs:
params:
name: Determine configuration
outputs:
move-tags: ${{ github.event_name == 'workflow_dispatch' && inputs.move-tags || 'true' }}
publish-github-release: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-github-release || 'true' }}
release-tag: ${{ github.event_name == 'workflow_dispatch' && inputs.release-tag || 'latest' }}
release-channel: stable
permissions:
contents: none
runs-on: ubuntu-24.04
steps:
- if: false
name: Noop
run: exit 0
changelog:
name: Changelog
needs:
- params
outputs:
version: ${{ steps.changelog.outputs.version-current }}
permissions:
contents: read
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
sparse-checkout: package.json
sparse-checkout-cone-mode: false
- id: version
name: Extract current version
run: echo "root-version=$(jq --raw-output '.version' package.json)" >> $GITHUB_OUTPUT
- id: changelog
name: Generate changelog
uses: oliversalzburg/action-automatic-semantic-releases@v3.3.2
with:
changelog-artifact: changelog.json
dry-run: true
publish: false
repo-token: ${{ secrets.GITHUB_TOKEN }}
root-version: ${{ steps.version.outputs.root-version }}
- name: Store changelog
uses: actions/upload-artifact@v7
with:
name: changelog.json
path: changelog.json
qa:
name: 🔹 QA
permissions:
contents: read
packages: read
uses: ./.github/workflows/qa.yml
release:
if: |
always()
&& contains(needs.*.result, 'success')
&& !contains(needs.*.result, 'failure')
&& needs.params.outputs.publish-github-release == 'true'
name: Release
needs:
- changelog
- params
- qa
permissions:
actions: write
attestations: write
contents: write
id-token: write
packages: write
pull-requests: read
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Select Node.js version
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Load cached dependencies
uses: actions/cache@v6
with:
path: ~/.npm
key: ${{ runner.os }}-node{{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node${{ env.NODE_VERSION }}
- name: Build release
env:
RELEASE_CHANNEL: ${{ needs.params.outputs.release-channel }}
RELEASE_VERSION: ${{ needs.changelog.outputs.version }}
run: make
- name: Download changelog
uses: actions/download-artifact@v8
with:
name: changelog.json
- name: Generate GitHub release
uses: oliversalzburg/action-automatic-semantic-releases@v3.3.2
with:
body-suffix: |
---
- Release generated by <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
changelog-artifact: changelog.json
draft: true
dry-run: ${{ needs.params.outputs.move-tags == 'false' }}
files: |
output/*.css
output/*.js
merge-similar: true
prerelease: false
repo-token: ${{ secrets.GITHUB_TOKEN }}
title: v${{ needs.changelog.outputs.version }}
with-authors: false