Skip to content

Commit b269dd8

Browse files
feat(ci): desktop workflow with platform jobs (hoppscotch#5568)
This updates the Desktop Self Host workflow with selective platform builds, standardized secret naming, and artifact organization, synchronizing with the CI workflow patterns and completing the broader CI/CD updation cycle.
1 parent 8b164f9 commit b269dd8

File tree

1 file changed

+56
-31
lines changed

1 file changed

+56
-31
lines changed

.github/workflows/build-hoppscotch-desktop.yml

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
default: "hoppscotch/hoppscotch"
1212
branch:
1313
description: Branch to checkout
14-
required: false
14+
required: true
1515
default: "main"
1616
tag:
1717
description: Tag to checkout (takes precedence over branch if provided)
@@ -26,6 +26,26 @@ on:
2626
required: false
2727
type: boolean
2828
default: false
29+
build_linux:
30+
description: Build for Linux
31+
type: boolean
32+
required: false
33+
default: true
34+
build_windows:
35+
description: Build for Windows
36+
type: boolean
37+
required: false
38+
default: true
39+
build_macos_x64:
40+
description: Build for macOS x64
41+
type: boolean
42+
required: false
43+
default: true
44+
build_macos_arm64:
45+
description: Build for macOS ARM64
46+
type: boolean
47+
required: false
48+
default: true
2949
env:
3050
CARGO_TERM_COLOR: always
3151
WORKSPACE_PATH: ${{ github.workspace }}
@@ -35,18 +55,19 @@ env:
3555
jobs:
3656
build-linux:
3757
runs-on: ubuntu-24.04
58+
if: ${{ inputs.build_linux }}
3859
steps:
3960
- uses: actions/checkout@v3
4061
with:
4162
repository: ${{ inputs.repository }}
4263
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
43-
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
64+
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
4465
- uses: actions/setup-node@v3
4566
with:
4667
node-version: 20
4768
- uses: pnpm/action-setup@v4
4869
with:
49-
version: 10.2.1
70+
version: 10.18.3
5071
- uses: actions-rs/toolchain@v1
5172
with:
5273
toolchain: nightly
@@ -131,16 +152,17 @@ jobs:
131152
- name: Upload artifacts
132153
uses: actions/upload-artifact@v4
133154
with:
134-
name: linux
155+
name: selfhost-desktop-linux
135156
path: dist/*
136157
build-windows:
137158
runs-on: windows-latest
159+
if: ${{ inputs.build_windows }}
138160
steps:
139161
- uses: actions/checkout@v3
140162
with:
141163
repository: ${{ inputs.repository }}
142164
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
143-
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
165+
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
144166
- name: Set Perl environment variables
145167
shell: pwsh
146168
run: |
@@ -151,7 +173,7 @@ jobs:
151173
node-version: 20
152174
- uses: pnpm/action-setup@v4
153175
with:
154-
version: 10.2.1
176+
version: 10.18.3
155177
- uses: actions-rs/toolchain@v1
156178
with:
157179
toolchain: nightly
@@ -161,7 +183,7 @@ jobs:
161183
shell: pwsh
162184
run: |
163185
$ProgressPreference = 'SilentlyContinue'
164-
Invoke-WebRequest -Uri "https://github.com/Levminer/trusted-signing-cli/releases/download/0.5.0/trusted-signing-cli.exe" -OutFile "trusted-signing-cli.exe"
186+
Invoke-WebRequest -Uri "https://github.com/Levminer/trusted-signing-cli/releases/download/0.8.0/trusted-signing-cli.exe" -OutFile "trusted-signing-cli.exe"
165187
Move-Item -Path "trusted-signing-cli.exe" -Destination "$env:GITHUB_WORKSPACE\trusted-signing-cli.exe"
166188
echo "$env:GITHUB_WORKSPACE" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
167189
- name: Setting up Windows Signing Environment
@@ -238,22 +260,23 @@ jobs:
238260
- name: Upload artifacts
239261
uses: actions/upload-artifact@v4
240262
with:
241-
name: windows
263+
name: selfhost-desktop-windows
242264
path: dist/*
243265
build-macos-x64:
244266
runs-on: macos-latest
267+
if: ${{ inputs.build_macos_x64 }}
245268
steps:
246269
- uses: actions/checkout@v3
247270
with:
248271
repository: ${{ inputs.repository }}
249272
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
250-
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
273+
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
251274
- uses: actions/setup-node@v3
252275
with:
253276
node-version: 20
254277
- uses: pnpm/action-setup@v4
255278
with:
256-
version: 10.2.1
279+
version: 10.18.3
257280
- uses: actions-rs/toolchain@v1
258281
with:
259282
toolchain: nightly
@@ -271,8 +294,8 @@ jobs:
271294
- uses: apple-actions/import-codesign-certs@v3
272295
if: ${{ inputs.disable_signing != true }}
273296
with:
274-
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
275-
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
297+
p12-file-base64: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE }}
298+
p12-password: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE_PASSWORD }}
276299
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
277300
- uses: actions/cache@v4
278301
with:
@@ -310,10 +333,10 @@ jobs:
310333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
311334
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
312335
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
313-
APPLE_ID: ${{ secrets.APPLE_ID }}
314-
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
315-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
316-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
336+
APPLE_ID: ${{ secrets.HOPPSCOTCH_APPLE_ID }}
337+
APPLE_PASSWORD: ${{ secrets.HOPPSCOTCH_APPLE_PASSWORD }}
338+
APPLE_TEAM_ID: ${{ secrets.HOPPSCOTCH_APPLE_TEAM_ID }}
339+
APPLE_SIGNING_IDENTITY: ${{ secrets.HOPPSCOTCH_APPLE_SIGNING_IDENTITY }}
317340
RUST_LOG: debug
318341
run: pnpm --dir ${{ env.DESKTOP_PATH }} tauri build --verbose --target x86_64-apple-darwin
319342
- name: Build Tauri app without Apple signing
@@ -334,22 +357,23 @@ jobs:
334357
- name: Upload artifacts
335358
uses: actions/upload-artifact@v4
336359
with:
337-
name: macos-x64
360+
name: selfhost-desktop-macos-x64
338361
path: dist/*
339362
build-macos-arm64:
340363
runs-on: macos-latest
364+
if: ${{ inputs.build_macos_arm64 }}
341365
steps:
342366
- uses: actions/checkout@v3
343367
with:
344368
repository: ${{ inputs.repository }}
345369
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
346-
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
370+
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
347371
- uses: actions/setup-node@v3
348372
with:
349373
node-version: 20
350374
- uses: pnpm/action-setup@v4
351375
with:
352-
version: 10.2.1
376+
version: 10.18.3
353377
- uses: actions-rs/toolchain@v1
354378
with:
355379
toolchain: nightly
@@ -367,8 +391,8 @@ jobs:
367391
- uses: apple-actions/import-codesign-certs@v3
368392
if: ${{ inputs.disable_signing != true }}
369393
with:
370-
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
371-
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
394+
p12-file-base64: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE }}
395+
p12-password: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE_PASSWORD }}
372396
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
373397
- uses: actions/cache@v4
374398
with:
@@ -406,10 +430,10 @@ jobs:
406430
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
407431
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
408432
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
409-
APPLE_ID: ${{ secrets.APPLE_ID }}
410-
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
411-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
412-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
433+
APPLE_ID: ${{ secrets.HOPPSCOTCH_APPLE_ID }}
434+
APPLE_PASSWORD: ${{ secrets.HOPPSCOTCH_APPLE_PASSWORD }}
435+
APPLE_TEAM_ID: ${{ secrets.HOPPSCOTCH_APPLE_TEAM_ID }}
436+
APPLE_SIGNING_IDENTITY: ${{ secrets.HOPPSCOTCH_APPLE_SIGNING_IDENTITY }}
413437
RUST_LOG: debug
414438
run: pnpm --dir ${{ env.DESKTOP_PATH }} tauri build --verbose --target aarch64-apple-darwin
415439
- name: Build Tauri app without Apple signing
@@ -430,11 +454,12 @@ jobs:
430454
- name: Upload artifacts
431455
uses: actions/upload-artifact@v4
432456
with:
433-
name: macos-aarch64
457+
name: selfhost-desktop-macos-aarch64
434458
path: dist/*
435459
create-update-manifest:
436460
needs: [build-linux, build-windows, build-macos-x64, build-macos-arm64]
437461
runs-on: ubuntu-latest
462+
if: ${{ inputs.build_linux && inputs.build_windows && inputs.build_macos_x64 && inputs.build_macos_arm64 }}
438463
steps:
439464
- name: Download all artifacts
440465
uses: actions/download-artifact@v4
@@ -452,19 +477,19 @@ jobs:
452477
"pub_date": "${CURRENT_DATE}",
453478
"platforms": {
454479
"linux-x86_64": {
455-
"signature": "$(cat artifacts/linux/Hoppscotch_SelfHost_linux_x64.AppImage.sig)",
480+
"signature": "$(cat artifacts/selfhost-desktop-linux/Hoppscotch_SelfHost_linux_x64.AppImage.sig)",
456481
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_linux_x64.AppImage"
457482
},
458483
"windows-x86_64": {
459-
"signature": "$(cat artifacts/windows/Hoppscotch_SelfHost_win_x64.msi.sig)",
484+
"signature": "$(cat artifacts/selfhost-desktop-windows/Hoppscotch_SelfHost_win_x64.msi.sig)",
460485
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_win_x64.msi"
461486
},
462487
"darwin-x86_64": {
463-
"signature": "$(cat artifacts/macos-x64/Hoppscotch_SelfHost_mac_x64.tar.gz.sig)",
488+
"signature": "$(cat artifacts/selfhost-desktop-macos-x64/Hoppscotch_SelfHost_mac_x64.tar.gz.sig)",
464489
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_mac_x64.tar.gz"
465490
},
466491
"darwin-aarch64": {
467-
"signature": "$(cat artifacts/macos-aarch64/Hoppscotch_SelfHost_mac_aarch64.tar.gz.sig)",
492+
"signature": "$(cat artifacts/selfhost-desktop-macos-aarch64/Hoppscotch_SelfHost_mac_aarch64.tar.gz.sig)",
468493
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_mac_aarch64.tar.gz"
469494
}
470495
}
@@ -473,5 +498,5 @@ jobs:
473498
- name: Upload manifest
474499
uses: actions/upload-artifact@v4
475500
with:
476-
name: update-manifest
501+
name: selfhost-desktop-update-manifest
477502
path: artifacts/hoppscotch-selfhost-desktop.json

0 commit comments

Comments
 (0)