From 5233e90dced20a1cb290cf32c3dccf25c11798ae Mon Sep 17 00:00:00 2001 From: nessi Date: Wed, 18 Mar 2026 14:27:26 +0100 Subject: [PATCH] feat: add macOS desktop client build workflow with ARM64 support and fix tunnel metrics task ownership Add macos-desktop-client.yml workflow with manual dispatch trigger running on macos-arm64 runner. Install Node.js 22 and Rust toolchain with aarch64-apple-darwin target. Build bundled tunnel helper and Tauri application bundle, then upload .app, .dmg, and raw build artifacts. Fix tunnel_metrics handler to clone app handle before spawn_blocking to prevent ownership issues when passing to tunnel --- .gitea/workflows/macos-desktop-client.yml | 55 +++++++++++++++++++++++ desktop-client/src-tauri/src/lib.rs | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/macos-desktop-client.yml diff --git a/.gitea/workflows/macos-desktop-client.yml b/.gitea/workflows/macos-desktop-client.yml new file mode 100644 index 0000000..671013c --- /dev/null +++ b/.gitea/workflows/macos-desktop-client.yml @@ -0,0 +1,55 @@ +name: Build macOS Desktop Client + +on: + workflow_dispatch: + +jobs: + build-macos-client: + name: Build macOS Client + runs-on: macos-arm64 + + defaults: + run: + shell: bash + working-directory: desktop-client + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin + + - name: Install desktop client dependencies + run: npm install + + - name: Build bundled macOS tunnel helper + run: npm run helper:macos-arm64 + + - name: Build macOS application bundle + run: npx tauri build --target aarch64-apple-darwin + + - name: Upload macOS app bundle + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: NexaVPN-macos-app + path: | + desktop-client/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app + desktop-client/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg + if-no-files-found: error + + - name: Upload raw macOS build outputs + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: NexaVPN-macos-raw-build + path: | + desktop-client/src-tauri/target/aarch64-apple-darwin/release/nexavpn-desktop + desktop-client/src-tauri/bundled/macos-arm64/nexavpn-tunnel-helper + if-no-files-found: error diff --git a/desktop-client/src-tauri/src/lib.rs b/desktop-client/src-tauri/src/lib.rs index 01c0308..0a0252f 100644 --- a/desktop-client/src-tauri/src/lib.rs +++ b/desktop-client/src-tauri/src/lib.rs @@ -486,8 +486,9 @@ async fn tunnel_metrics(app: AppHandle, state: State<'_, AppState>) -> Result