-
Notifications
You must be signed in to change notification settings - Fork 0
283 lines (237 loc) · 7.81 KB
/
release.yml
File metadata and controls
283 lines (237 loc) · 7.81 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: Update Version
on:
workflow_dispatch:
inputs:
tag:
description: Existing release tag to publish (vX.Y.Z)
required: true
type: string
push:
tags:
- "v*"
permissions:
contents: write
jobs:
prepare-release:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.release-tag.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Resolve release tag
id: release-tag
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
release_tag="${{ inputs.tag }}"
else
release_tag="${{ github.ref_name }}"
fi
if [[ ! "$release_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Release tag must match vX.Y.Z, got: $release_tag" >&2
exit 1
fi
echo "release_tag=$release_tag" >> "$GITHUB_OUTPUT"
- name: Verify tag exists
shell: bash
run: |
set -euo pipefail
release_tag="${{ steps.release-tag.outputs.release_tag }}"
git fetch --force --tags origin
git rev-parse --verify "refs/tags/$release_tag" >/dev/null
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ steps.release-tag.outputs.release_tag }}
shell: bash
run: |
set -euo pipefail
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release edit "$RELEASE_TAG" --title "$RELEASE_TAG"
else
gh release create "$RELEASE_TAG" \
--title "$RELEASE_TAG" \
--generate-notes \
--verify-tag
fi
release-linux:
needs: prepare-release
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ needs.prepare-release.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
submodules: recursive
persist-credentials: false
- name: Install Linux packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y strip-nondeterminism libarchive-tools
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --loglevel=info
- name: Fetch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run fetch
- name: Compile
run: bun run webpack:prod
- name: Package
run: |
node release-automation/build.js --debian --tarball --appimage --x64 --armv7l --arm64 --production
node release-automation/build.js --pacman --x64 --arm64 --production
- name: Print file tree
run: node scripts/print-file-tree.js dist
- name: Upload artifacts to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: linux
path: |
dist/*.deb
dist/*.tar.gz
dist/*.AppImage
dist/*.pkg.tar.zst
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
shell: bash
run: |
set -euo pipefail
gh release upload "$RELEASE_TAG" \
dist/*.deb \
dist/*.tar.gz \
dist/*.AppImage \
dist/*.pkg.tar.zst \
--clobber
release-mac:
needs: prepare-release
runs-on: macos-latest
env:
RELEASE_TAG: ${{ needs.prepare-release.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
submodules: recursive
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --loglevel=info
- name: Fetch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run fetch
- name: Compile
run: bun run webpack:prod
- name: Package
run: |
node release-automation/build.js --mac --universal
node release-automation/build.js --mac-legacy-10.13-10.14 --mac-legacy-10.15 --x64
- name: Print file tree
run: node scripts/print-file-tree.js dist
- name: Upload artifacts to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: mac
path: dist/*.dmg
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
shell: bash
run: |
set -euo pipefail
gh release upload "$RELEASE_TAG" dist/*.dmg --clobber
release-windows:
needs: prepare-release
runs-on: windows-latest
env:
RELEASE_TAG: ${{ needs.prepare-release.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
submodules: recursive
persist-credentials: false
path: repo
- name: "Move repository to D: drive"
run: |
Copy-Item -Path repo -Destination D:\repo -Recurse
Remove-Item -Path repo -Recurse -Force
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: "Configure Bun cache and prefix to D: drive"
run: |
echo "BUN_INSTALL_CACHE_DIR=D:\bun-cache" >> $GITHUB_ENV
echo "BUN_INSTALL_GLOBAL_DIR=D:\bun-global" >> $GITHUB_ENV
- name: Install dependencies
working-directory: D:\repo
run: bun install --loglevel=info
- name: Fetch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: D:\repo
run: bun run fetch
- name: Compile
working-directory: D:\repo
run: bun run webpack:prod
- name: Package
working-directory: D:\repo
run: |
node release-automation/build.js --windows --microsoft-store --x64 --ia32 --arm64 --production
node release-automation/build.js --windows-portable --x64 --production
node release-automation/build.js --windows-legacy --ia32 --x64 --production
- name: Print file tree
working-directory: D:\repo
run: node scripts/print-file-tree.js dist
- name: Sign Windows application
working-directory: D:\repo
run: deepsigntool\sign_windows.cmd
- name: Upload signed artifacts to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: windows-signed
path: |
D:\repo\windows_signed\*.exe
D:\repo\dist\*.appx
- name: Upload artifacts to release
working-directory: D:\repo
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
shell: pwsh
run: |
$files = @(
Get-ChildItem -Path 'D:\repo\windows_signed\*.exe' -File | Select-Object -ExpandProperty FullName
Get-ChildItem -Path 'D:\repo\dist\*.appx' -File | Select-Object -ExpandProperty FullName
) | Where-Object { $_ }
if (-not $files) {
throw 'No Windows release assets were found to upload.'
}
gh release upload $env:RELEASE_TAG @files --clobber