11name : Desktop build
22
3- # Builds the OpenKB desktop app (Tauri shell + frozen openkb-api sidecar).
3+ # Builds the OpenKB desktop app (Tauri shell + frozen openkb-api sidecar) for
4+ # every platform, and — on a `desktop-v*` tag — attaches the installers to a
5+ # GitHub Release.
46#
57# Neither half cross-compiles — PyInstaller freezes for the host OS/arch and
6- # Tauri links the platform WebView — so each target is its own runner. This
7- # workflow starts with Linux only; add the Windows / macOS(arm+intel) matrix
8- # entries below once the Linux path is proven (see the commented block).
8+ # Tauri links the platform WebView — so each target is its own runner. macOS
9+ # arm64/x86_64 are separate runners (native builds; no --target needed).
910#
1011# Ordering within a job matters: build the web UI FIRST (npm run build →
1112# openkb/web), THEN freeze the sidecar (build_sidecar.sh bundles openkb/web),
@@ -32,21 +33,20 @@ jobs:
3233 include :
3334 - os : ubuntu-22.04
3435 target : linux
35- # Added once Linux is proven (each needs its own sidecar freeze):
36- # - os: windows-latest # -> .msi / .exe (NSIS)
37- # target: windows
38- # - os: macos-14 # -> .dmg (aarch64, Apple Silicon)
39- # target: macos-arm64
40- # - os: macos-13 # -> .dmg (x86_64, Intel)
41- # target: macos-intel
36+ - os : windows-latest
37+ target : windows
38+ - os : macos-14 # Apple Silicon
39+ target : macos-arm64
40+ - os : macos-13 # Intel
41+ target : macos-intel
4242 runs-on : ${{ matrix.os }}
4343 steps :
44- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
44+ - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4545 with :
4646 persist-credentials : false
4747
48- # Tauri's Linux WebView + bundler dependencies (webkit2gtk 4.1, appindicator,
49- # rsvg for icon rendering). No-op on non-Linux targets .
48+ # Tauri's Linux WebView + bundler dependencies. Windows (WebView2) and
49+ # macOS (WebKit) ship theirs with the OS, so this is Linux-only .
5050 - name : Install Linux WebView deps
5151 if : matrix.target == 'linux'
5252 run : |
@@ -55,17 +55,16 @@ jobs:
5555 libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev \
5656 build-essential curl wget file libxdo-dev libssl-dev
5757
58- - uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
58+ - uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
5959 with :
6060 python-version : " 3.12"
6161
6262 # openkb.api (the sidecar) + PyInstaller. PyInstaller is a build tool, not
63- # a runtime dep, so it's installed ad-hoc here rather than pinned in
64- # pyproject.
63+ # a runtime dep, so it's installed ad-hoc rather than pinned in pyproject.
6564 - name : Install openkb + build tools
6665 run : pip install -e ".[api]" pyinstaller
6766
68- - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
67+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
6968 with :
7069 node-version : " 20"
7170
@@ -76,20 +75,23 @@ jobs:
7675 npm ci
7776 npm run build
7877
78+ # `shell: bash` so the same script runs on Windows (git-bash) too.
79+ # PyInstaller emits openkb-api-sidecar(.exe) for the host OS/arch.
7980 - name : Freeze API sidecar
80- run : PYTHON="$(which python)" bash desktop/packaging/build_sidecar.sh
81+ shell : bash
82+ run : PYTHON=python bash desktop/packaging/build_sidecar.sh
8183
82- # ubuntu runners ship a stable Rust toolchain, so no toolchain action is
83- # needed. tauri-cli is installed from crates.io (locked) rather than via a
84- # third-party action, to keep the supply chain explicit and pin-friendly .
84+ # ubuntu/macos/windows runners ship a stable Rust toolchain. tauri-cli is
85+ # installed from crates.io (locked) rather than via a third-party action,
86+ # to keep the supply chain explicit.
8587 - name : Install tauri-cli
8688 run : cargo install tauri-cli --version "^2" --locked
8789
8890 - name : Build Tauri bundle
8991 working-directory : desktop/src-tauri
9092 run : cargo tauri build
9193
92- # TODO: pin to a SHA to match the repo's action-pinning policy.
94+ # TODO: pin actions/upload-artifact to a SHA to match the repo policy.
9395 - name : Upload installers
9496 uses : actions/upload-artifact@v4
9597 with :
@@ -102,3 +104,28 @@ jobs:
102104 desktop/src-tauri/target/release/bundle/**/*.msi
103105 desktop/src-tauri/target/release/bundle/**/*.exe
104106 if-no-files-found : warn
107+
108+ # Attach every platform's installers to a GitHub Release, but only for a
109+ # `desktop-v*` tag. Signing/notarization (macOS Gatekeeper, Windows
110+ # SmartScreen) is not configured yet — these are unsigned artifacts.
111+ release :
112+ if : startsWith(github.ref, 'refs/tags/desktop-v')
113+ needs : build
114+ runs-on : ubuntu-latest
115+ permissions :
116+ contents : write
117+ steps :
118+ # TODO: pin actions/download-artifact to a SHA to match the repo policy.
119+ - name : Download all installers
120+ uses : actions/download-artifact@v4
121+ with :
122+ path : installers
123+ merge-multiple : true
124+
125+ - name : Create / update the release
126+ uses : softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
127+ with :
128+ tag_name : ${{ github.ref_name }}
129+ name : ${{ github.ref_name }}
130+ generate_release_notes : true
131+ files : installers/**/*
0 commit comments