-
Notifications
You must be signed in to change notification settings - Fork 9
378 lines (328 loc) · 14.7 KB
/
Copy pathdesktop-build.yml
File metadata and controls
378 lines (328 loc) · 14.7 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
name: Desktop App CI
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
on:
push:
branches: [master]
jobs:
build-macos:
runs-on: macos-26-xlarge
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
# Xcode 26.5 is temporarily exposed as a beta app on macos-26 runners: https://github.com/actions/runner-images/issues/14108
- name: Select Xcode 26.5
run: |
set -euo pipefail
for xcode_app in \
/Applications/Xcode_26.5.0.app \
/Applications/Xcode_26.5_beta_2.app \
/Applications/Xcode_26.5_beta.app
do
if [ -x "${xcode_app}/Contents/Developer/usr/bin/xcodebuild" ]; then
sudo xcode-select -s "${xcode_app}/Contents/Developer"
xcodebuild -version
exit 0
fi
done
echo "Xcode 26.5 is not installed on this runner." >&2
ls -1 /Applications/Xcode*.app >&2 || true
exit 1
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # was v22
with:
github-token: ""
- name: Cache sccache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: ~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-macos-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-macos-release-
${{ runner.os }}-sccache-macos-
${{ runner.os }}-sccache-
- name: Build Tauri App (macOS, signed)
run: nix develop .#ci -c ./scripts/ci/desktop-release.sh
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Show sccache stats
if: always()
run: nix develop .#ci -c sccache --show-stats
- name: Collect macOS release checksums
run: |
nix develop .#ci -c ./scripts/ci/attestation-manifest.sh \
desktop-macos-artifacts.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-macos-final.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-macos-*.sha256
cat desktop-macos-artifacts.sha256
- name: Attest macOS release artifacts
# Keep uploads/verifiers running if GitHub token policy rejects artifact attestation.
continue-on-error: true
uses: actions/attest@281a49d4cbb0a72c9575a50d18f6deb515a11deb # was v4
with:
subject-checksums: desktop-macos-artifacts.sha256
- name: Upload macOS Build
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # was v4
with:
name: maple-macos-universal
path: |
frontend/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
frontend/src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
frontend/src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz
frontend/src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz.sig
frontend/src-tauri/target/reproducibility/*.sha256
retention-days: 5
build-linux:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # was v22
with:
github-token: ""
- name: Cache sccache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache-linux-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-linux-release-
${{ runner.os }}-sccache-linux-
${{ runner.os }}-sccache-
# Ubuntu 24.04 restricts unprivileged user namespaces by default; linuxdeploy/AppImage
# packaging uses bubblewrap and otherwise fails with "bwrap: setting up uid map: Permission denied".
- name: Allow bubblewrap user namespaces
run: |
set -euo pipefail
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
if [ -e /proc/sys/kernel/unprivileged_userns_clone ]; then
sudo sysctl -w kernel.unprivileged_userns_clone=1
fi
- name: Build Tauri App (Linux, signed updater)
run: nix develop .#desktop-linux -c ./scripts/ci/desktop-release.sh
env:
APPIMAGE_EXTRACT_AND_RUN: "1"
NO_STRIP: "true"
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Show sccache stats
if: always()
run: nix develop .#desktop-linux -c sccache --show-stats
- name: Collect Linux release checksums
run: |
nix develop .#desktop-linux -c ./scripts/ci/attestation-manifest.sh \
desktop-linux-artifacts.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-linux-final.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-linux-*.sha256
cat desktop-linux-artifacts.sha256
- name: Attest Linux release artifacts
# Keep uploads/verifiers running if GitHub token policy rejects artifact attestation.
continue-on-error: true
uses: actions/attest@281a49d4cbb0a72c9575a50d18f6deb515a11deb # was v4
with:
subject-checksums: desktop-linux-artifacts.sha256
- name: Upload Linux Builds
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # was v4
with:
name: maple-linux
path: |
frontend/src-tauri/target/release/bundle/appimage/*.AppImage
frontend/src-tauri/target/release/bundle/appimage/*.AppImage.sig
frontend/src-tauri/target/release/bundle/deb/*.deb
frontend/src-tauri/target/release/bundle/deb/*.deb.sig
frontend/src-tauri/target/release/bundle/rpm/*.rpm
frontend/src-tauri/target/release/bundle/rpm/*.rpm.sig
frontend/src-tauri/target/reproducibility/*.sha256
retention-days: 5
verify-linux-desktop-artifacts:
needs:
- build-linux
runs-on: ubuntu-latest-8-cores
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # was v22
with:
github-token: ""
- name: Download Linux desktop artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # was v4
with:
name: maple-linux
path: artifacts
- name: Verify Linux desktop artifact reproducibility proofs
run: nix develop .#desktop-linux -c ./scripts/ci/verify-release-artifacts.sh artifacts linux
verify-macos-desktop-artifacts:
needs:
- build-macos
runs-on: macos-26-xlarge
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # was v22
with:
github-token: ""
- name: Download macOS desktop artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # was v4
with:
name: maple-macos-universal
path: artifacts
- name: Verify macOS desktop artifact reproducibility proofs
run: nix develop .#ci -c ./scripts/ci/verify-release-artifacts.sh artifacts macos
build-windows:
runs-on: windows-2025
environment: windows-signing
env:
MAPLE_WINDOWS_ARTIFACT_SIGNING_ENDPOINT: ${{ secrets.AZURE_ARTIFACT_SIGNING_ENDPOINT }}
MAPLE_WINDOWS_ARTIFACT_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_ARTIFACT_SIGNING_ACCOUNT_NAME }}
MAPLE_WINDOWS_ARTIFACT_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_ARTIFACT_SIGNING_CERTIFICATE_PROFILE_NAME }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # was v1
with:
bun-version: 1.3.5
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # was stable
with:
toolchain: 1.94.1
- name: Install sccache
shell: bash
run: |
SCCACHE_VERSION=0.8.2
SCCACHE_SHA256="de5e9f66bb8a6bbdf0e28cb8a086a8d12699af796bf70bcd9dc40d80715bf9b8"
SCCACHE_ARCHIVE="sccache-v${SCCACHE_VERSION}-x86_64-pc-windows-msvc.tar.gz"
SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/${SCCACHE_ARCHIVE}"
# Run download/verify/extract inside a subshell cd'd to RUNNER_TEMP so
# the archive and target dir are referenced by relative names. MSYS2 tar
# mangles Windows paths like D:\a when given absolute -C/-f arguments
# (even with --force-local); relative paths sidestep that.
(
cd "$RUNNER_TEMP"
curl --fail --location --show-error --silent "$SCCACHE_URL" --output "$SCCACHE_ARCHIVE"
echo "${SCCACHE_SHA256} ${SCCACHE_ARCHIVE}" | sha256sum --check -
tar xzf "$SCCACHE_ARCHIVE"
)
SCCACHE_BIN_DIR="$RUNNER_TEMP/sccache-v${SCCACHE_VERSION}-x86_64-pc-windows-msvc"
echo "$SCCACHE_BIN_DIR" >> "$GITHUB_PATH"
"$SCCACHE_BIN_DIR/sccache.exe" --version
- name: Cache sccache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: ~\AppData\Local\Mozilla\sccache
key: ${{ runner.os }}-sccache-windows-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-windows-
${{ runner.os }}-sccache-
- name: Build Windows app executable
shell: bash
run: ./scripts/ci/desktop-windows-release.sh build
- name: Bundle Windows unsigned installer baseline
shell: bash
run: ./scripts/ci/desktop-windows-release.sh unsigned-bundle
- name: Azure login for Artifact Signing
uses: azure/login@2dd0bbf4064d5a1812889dc200bb8eed2597f82a # was v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Install Artifact Signing module
shell: pwsh
run: ./scripts/ci/install-windows-artifact-signing.ps1
- name: Bundle Windows installer
shell: bash
run: ./scripts/ci/desktop-windows-release.sh bundle
- name: Resolve Windows installer paths
shell: bash
run: |
set -euo pipefail
source scripts/ci/_common.sh
setup_exe="$(windows_release_setup_exe_required)"
echo "MAPLE_WINDOWS_SETUP_EXE_REL=$(repo_relative_path "${setup_exe}")" >> "${GITHUB_ENV}"
- name: Install minisign
shell: pwsh
run: ./scripts/ci/install-windows-minisign.ps1
- name: Finalize Windows updater signatures and checksums
shell: bash
run: ./scripts/ci/desktop-windows-release.sh finalize
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Show sccache stats
if: always()
run: sccache --show-stats
- name: Collect Windows release checksums
shell: bash
run: |
./scripts/ci/attestation-manifest.sh \
desktop-windows-artifacts.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-windows-final.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-windows-signed-canonical.sha256 \
frontend/src-tauri/target/reproducibility/desktop-release-windows-runtime-dlls.sha256
cat desktop-windows-artifacts.sha256
- name: Attest Windows release artifacts
uses: actions/attest@281a49d4cbb0a72c9575a50d18f6deb515a11deb # was v4
with:
subject-checksums: desktop-windows-artifacts.sha256
- name: Upload Windows Build
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # was v4
with:
name: maple-windows-x64
path: |
${{ env.MAPLE_WINDOWS_SETUP_EXE_REL }}
${{ env.MAPLE_WINDOWS_SETUP_EXE_REL }}.sig
frontend/src-tauri/target/reproducibility/desktop-release-windows-*.sha256
retention-days: 5
verify-windows-desktop-artifacts:
needs:
- build-windows
runs-on: ubuntu-latest-8-cores
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # was v22
with:
github-token: ""
- name: Download Windows desktop artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # was v4
with:
name: maple-windows-x64
path: artifacts
- name: Verify Windows desktop artifact reproducibility proofs
run: nix develop .#ci -c ./scripts/ci/verify-release-artifacts.sh artifacts windows
verify-desktop-artifacts:
needs:
- verify-linux-desktop-artifacts
- verify-macos-desktop-artifacts
- verify-windows-desktop-artifacts
runs-on: ubuntu-latest
steps:
- name: Verify desktop artifact checks completed
run: echo "Desktop artifact verification completed for Linux, macOS, and Windows."