Skip to content

Commit 22175d9

Browse files
feat(desktop): land the desktop application stack on dev
Consolidates the desktop stack that was carried as a GitHub native stack on top of the macOS menu bar companion. #5196 landed as 38a5ab9 by squash, which detached every child in the chain from its base, so the remaining work is applied here as one branch against the current dev instead of replayed through bases that no longer exist. Carries the standalone binary, the Tauri v2 cross-platform tray and webview shell, the GUI desktop shell integration, the WidgetKit appex bundle, and the signed desktop packaging for DMG, MSI, AppImage and deb. Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 38a5ab9 commit 22175d9

161 files changed

Lines changed: 9441 additions & 3139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ on:
3535
- "tests/**"
3636
- "scripts/**"
3737
- "app/**"
38+
- "desktop/**"
3839
- "gui/**"
3940
- "assets/**"
4041
- ".gitattributes"
@@ -215,6 +216,7 @@ jobs:
215216
- 'tests/**'
216217
- 'scripts/**'
217218
- 'app/**'
219+
- 'desktop/**'
218220
- 'gui/**'
219221
- 'assets/**'
220222
- '.gitattributes'
@@ -1149,12 +1151,12 @@ jobs:
11491151
# `if: always()` is load-bearing. Without it, a failed or skipped dependency
11501152
# skips this job too — and GitHub reports a skipped job as success, so the gate
11511153
# would go green precisely when something went wrong.
1152-
macos-app:
1153-
name: macos app
1154+
widget:
1155+
name: macos widget + bundle
11541156
needs: [changes, gates]
11551157
if: github.event_name != 'pull_request' || needs.changes.outputs.ci == 'true'
11561158
runs-on: macos-latest
1157-
timeout-minutes: 20
1159+
timeout-minutes: 30
11581160
steps:
11591161
- name: Checkout
11601162
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
@@ -1167,13 +1169,80 @@ jobs:
11671169
bun-version: 1.3.14
11681170

11691171
- name: Install dependencies
1170-
run: bun install --frozen-lockfile
1172+
run: |
1173+
bun install --frozen-lockfile
1174+
cd desktop
1175+
bun install --frozen-lockfile
1176+
1177+
- name: Setup Rust
1178+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
1179+
with:
1180+
toolchain: stable
11711181

1172-
- name: Test macOS menu bar app
1182+
- name: Test MenuBarCore
11731183
run: bun run test:macos
11741184

1175-
- name: Build macOS menu bar app
1176-
run: bun run build:macos
1185+
- name: Build dashboard
1186+
run: bun run build:gui
1187+
1188+
- name: Prepare desktop sidecar
1189+
run: bun desktop/scripts/prepare-sidecar.ts
1190+
1191+
- name: Build WidgetKit appex
1192+
run: bash desktop/scripts/build-widget.sh
1193+
1194+
- name: Build unsigned desktop app
1195+
working-directory: desktop
1196+
run: bunx tauri build --ci --bundles app
1197+
1198+
- name: Verify WidgetKit appex and desktop app
1199+
run: |
1200+
app=desktop/src-tauri/target/release/bundle/macos/OpenCodex.app
1201+
test -x "$app/Contents/MacOS/OpenCodex"
1202+
test -x "$app/Contents/PlugIns/OpenCodexWidget.appex/Contents/MacOS/OpenCodexWidget"
1203+
test -x "$app/Contents/MacOS/ocx"
1204+
codesign -dv "$app/Contents/PlugIns/OpenCodexWidget.appex"
1205+
1206+
desktop-shell:
1207+
name: desktop shell
1208+
needs: [changes, gates]
1209+
if: github.event_name != 'pull_request' || needs.changes.outputs.ci == 'true'
1210+
runs-on: ubuntu-latest
1211+
timeout-minutes: 20
1212+
steps:
1213+
- name: Checkout
1214+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
1215+
with:
1216+
persist-credentials: false
1217+
1218+
- name: Install Tauri Linux dependencies
1219+
run: |
1220+
sudo apt-get update
1221+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
1222+
1223+
- name: Setup Rust
1224+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
1225+
with:
1226+
toolchain: stable
1227+
components: rustfmt, clippy
1228+
1229+
- name: Prepare desktop check resources
1230+
run: |
1231+
set -euo pipefail
1232+
triple="$(rustc -vV | sed -n 's/^host: //p')"
1233+
mkdir -p desktop/src-tauri/binaries desktop/src-tauri/resources/gui/dist
1234+
: > "desktop/src-tauri/binaries/ocx-${triple}"
1235+
chmod +x "desktop/src-tauri/binaries/ocx-${triple}"
1236+
: > desktop/src-tauri/resources/gui/dist/.keep
1237+
1238+
- name: Check Rust formatting
1239+
run: cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check
1240+
1241+
- name: Run Rust clippy
1242+
run: cargo clippy --manifest-path desktop/src-tauri/Cargo.toml --all-targets -- -D warnings
1243+
1244+
- name: Run Rust tests
1245+
run: cargo test --manifest-path desktop/src-tauri/Cargo.toml
11771246

11781247
ci:
11791248
name: ci
@@ -1182,7 +1251,7 @@ jobs:
11821251
# direct dependencies only, so a failing `select-windows-runner` would
11831252
# otherwise reach this gate as nothing at all while its dependents report
11841253
# `skipped`, which is the shape the step below is written to catch.
1185-
needs: [changes, select-windows-runner, test, storage-policy, api-usage, gates, platform-macos, macos-control, platform-windows, keyring-smoke, docker-smoke, docs-site-build, structure-gate, npm-global-smoke, macos-app]
1254+
needs: [changes, select-windows-runner, test, storage-policy, api-usage, gates, platform-macos, macos-control, platform-windows, keyring-smoke, docker-smoke, docs-site-build, structure-gate, npm-global-smoke, widget, desktop-shell]
11861255
runs-on: ubuntu-latest
11871256
timeout-minutes: 5
11881257
permissions:
@@ -1248,12 +1317,15 @@ jobs:
12481317
GATED_JOBS="changes select-windows-runner test storage-policy api-usage gates"
12491318
GATED_JOBS="$GATED_JOBS platform-macos keyring-smoke docker-smoke npm-global-smoke"
12501319
GATED_JOBS="$GATED_JOBS macos-control platform-windows docs-site-build"
1251-
GATED_JOBS="$GATED_JOBS structure-gate macos-app"
1320+
GATED_JOBS="$GATED_JOBS structure-gate widget"
1321+
GATED_JOBS="$GATED_JOBS desktop-shell"
12521322
12531323
expected_for() {
12541324
case "$1" in
12551325
changes|select-windows-runner) echo requested ;;
1256-
test|storage-policy|api-usage|gates|platform-macos|keyring-smoke|docker-smoke|macos-app)
1326+
test|storage-policy|api-usage|gates|platform-macos|keyring-smoke|docker-smoke|widget)
1327+
echo "$scoped" ;;
1328+
desktop-shell)
12571329
echo "$scoped" ;;
12581330
npm-global-smoke) echo "$packaging" ;;
12591331
docs-site-build) echo "$docs" ;;

0 commit comments

Comments
 (0)