-
-
Notifications
You must be signed in to change notification settings - Fork 43
404 lines (339 loc) · 12.5 KB
/
Copy pathrelease.yml
File metadata and controls
404 lines (339 loc) · 12.5 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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
name: Release
on:
workflow_dispatch:
inputs:
create_release:
description: "create release"
type: boolean
default: false
push_update_manifests:
description: "push update manifests"
type: boolean
default: false
updates_branch:
description: "updates branch"
type: string
default: "main"
sign:
description: "sign"
type: boolean
default: false
linux:
description: "linux"
type: boolean
default: true
macos:
description: "macos"
type: boolean
default: true
windows:
description: "windows"
type: boolean
default: true
jobs:
metadata:
name: metadata
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
build_id: ${{ steps.get_build_id.outputs.build_id }}
steps:
- name: Inputs
run: echo $INPUTS
env:
INPUTS: ${{ toJSON(inputs) }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Configure git
run: |
git config --global \
url."https://github.com/mozilla-firefox/firefox.git".insteadOf \
"git@github.com:mozilla-firefox/firefox.git"
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Get version
id: version
run: |
echo "version=$(pnpm --silent tsn scripts/version.mts)" >> $GITHUB_OUTPUT
- id: get_build_id
run: |
build_date=`date +"%Y%m%d%I%M%S"`
echo "build_id=${build_date}" >> $GITHUB_OUTPUT
echo "build_id=${build_date}"
- name: Create draft release
if: ${{ inputs.create_release }}
run: |
if gh release view $VERSION > /dev/null 2>&1; then
gh release edit $VERSION --draft --title "$VERSION" --target "$RELEASE_SHA"
else
gh release create $VERSION --draft --title "$VERSION" --target "$RELEASE_SHA"
fi
env:
GH_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
RELEASE_SHA: ${{ github.sha }}
linux:
if: ${{ inputs.linux }}
name: Linux build
uses: ./.github/workflows/linux-build.yml
needs: [metadata]
with:
upload: true
MOZ_BUILD_DATE: ${{ needs.metadata.outputs.build_id }}
macos:
if: ${{ inputs.macos }}
name: macOS build
uses: ./.github/workflows/macos-build.yml
needs: [metadata]
with:
artifacts: true
MOZ_BUILD_DATE: ${{ needs.metadata.outputs.build_id }}
macos-sign:
if: ${{ inputs.sign && inputs.macos }}
name: macOS sign
needs: [macos]
uses: ./.github/workflows/macos-sign.yml
secrets:
MACOS_P12_BASE64: ${{ secrets.MACOS_P12_BASE64 }}
MACOS_P12_PASSWORD: ${{ secrets.MACOS_P12_PASSWORD }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
APPLE_DEVELOPER_ID: ${{ secrets.APPLE_DEVELOPER_ID }}
APPLE_ACCOUNT_ID: ${{ secrets.APPLE_ACCOUNT_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_ID_PASSWORD: ${{ secrets.APPLE_APP_ID_PASSWORD }}
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
with:
artifacts: true
windows:
if: ${{ inputs.windows }}
name: Windows build
uses: ./.github/workflows/windows-build.yml
needs: [metadata]
with:
MOZ_BUILD_DATE: ${{ needs.metadata.outputs.build_id }}
source:
name: source
runs-on: ubuntu-latest
needs: [metadata]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Configure git
run: |
git config --global \
url."https://github.com/mozilla-firefox/firefox.git".insteadOf \
"git@github.com:mozilla-firefox/firefox.git"
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Bootstrap repo
run: |
pnpm bootstrap
- name: Compress
run: |
tar \
--exclude='./.git' \
--use-compress-program=zstd \
-hcf glide.source.tar.zst \
-C engine .
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
retention-days: 10
name: glide.source.tar.zst
path: ./glide.source.tar.zst
release:
if: ${{ inputs.create_release && !failure() && !cancelled() }}
name: Release
runs-on: ubuntu-latest
needs: [metadata, linux, macos, macos-sign, windows, source]
environment: release
steps:
- name: Check release is not published
run: |
if gh release view $VERSION --json isDraft --jq '.isDraft' | grep -q 'false'; then
echo -e "Error: Release $VERSION is already published. Refusing to continue."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
VERSION: ${{ needs.metadata.outputs.version }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download Linux build (aarch64)
if: ${{ inputs.linux }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: glide.linux-aarch64.tar.xz
- name: Download Linux build (x86_64)
if: ${{ inputs.linux }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: glide.linux-x86_64.tar.xz
- name: Download signed macOS DMG (aarch64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: glide.macos-aarch64.signed.dmg
- name: Download signed macOS DMG (x86_64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: glide.macos-x86_64.signed.dmg
- name: Download macOS MAR (aarch64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: macos-aarch64.mar
- name: Download macOS MAR (x86_64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: macos-x86_64.mar
- name: Download Windows installer (x86_64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-x86_64.installer.exe
- name: Download Windows installer (aarch64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-aarch64.installer.exe
- name: Download Windows MAR (x86_64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-x86_64.mar
- name: Download Windows MAR (aarch64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-aarch64.mar
- name: Download source tarball
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: glide.source.tar.zst
- name: Upload artifacts to the release
run: |
upload() {
enabled="$1"
filename="$2"
if [[ $enabled == "true" ]]; then
echo "uploading $filename"
gh release upload $VERSION $filename --clobber
else
echo "not uploading $filename as it was skipped"
fi
}
upload $WINDOWS ./glide.windows-aarch64.installer.exe
upload $WINDOWS ./glide.windows-x86_64.installer.exe
upload $LINUX ./glide.linux-aarch64.tar.xz
upload $LINUX ./glide.linux-x86_64.tar.xz
upload $MACOS ./glide.macos-aarch64.dmg
upload $MACOS ./glide.macos-x86_64.dmg
upload true ./glide.source.tar.zst
# MAR files
upload $MACOS ./macos-aarch64.mar
upload $MACOS ./macos-x86_64.mar
upload $WINDOWS ./windows-aarch64.mar
upload $WINDOWS ./windows-x86_64.mar
env:
MACOS: ${{ inputs.macos }}
LINUX: ${{ inputs.linux }}
WINDOWS: ${{ inputs.windows }}
GH_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
VERSION: ${{ needs.metadata.outputs.version }}
push-update-manifests:
if: ${{ inputs.push_update_manifests && !failure() && !cancelled() && (inputs.macos || inputs.windows) }}
name: Push update manifests
runs-on: ubuntu-latest
needs: [release, metadata]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Checkout update-server repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: glide-browser/update-server
token: ${{ secrets.REPO_ACCESS_TOKEN }}
path: update-server
ref: ${{ inputs.updates_branch }}
persist-credentials: true
# zizmor: ignore[artipacked]
# we push to the repo, so we do need to persist credentials
- name: Download macOS updates (aarch64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: macos-aarch64-updates
path: artifacts/macos-aarch64/
- name: Download macOS updates (x86_64)
if: ${{ inputs.macos }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: macos-x86_64-updates
path: artifacts/macos-x86_64/
- name: Download Windows updates (x86_64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-x86_64-updates
path: artifacts/windows-x86_64/
- name: Download Windows updates (aarch64)
if: ${{ inputs.windows }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-aarch64-updates
path: artifacts/windows-aarch64/
- name: Debug
run: |
tree -Dh artifacts/
- name: Copy update files to update-server
run: |
set -ex
mkdir -p update-server/public/versions/latest/
if [[ "$MACOS" == "true" ]]; then
cp -r artifacts/macos-aarch64/* update-server/public/versions/latest/
cp -r artifacts/macos-x86_64/* update-server/public/versions/latest/
fi
if [[ "$WINDOWS" == "true" ]]; then
cp -r artifacts/windows-x86_64/* update-server/public/versions/latest/
cp -r artifacts/windows-aarch64/* update-server/public/versions/latest/
fi
env:
MACOS: ${{ inputs.macos }}
WINDOWS: ${{ inputs.windows }}
- name: Debug
run: |
tree -Dh update-server/public/
- name: Commit and push updates
working-directory: update-server
run: |
git config user.name "glide-updater"
git config user.email "updates@glide-browser.app"
git add -A .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Add update files for version ${VERSION}"
git push
fi
env:
VERSION: "${{ needs.metadata.outputs.version }}"