From 0ca1c0cb3fb310404211b4130417c49fabfbb523 Mon Sep 17 00:00:00 2001 From: nessi Date: Wed, 18 Mar 2026 10:46:39 +0100 Subject: [PATCH] feat: add Gitea CI workflow for cross-compiling Windows desktop client on Linux Add workflow to build Windows desktop client using cargo-xwin on Linux runners. Install Node.js 22, Rust with x86_64-pc-windows-msvc target, and required system dependencies including NSIS for installer creation. Build bundled Windows tunnel helper and desktop client installer, then upload both NSIS installer artifacts and raw executables. --- .gitea/workflows/windows-desktop-client.yml | 85 +++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .gitea/workflows/windows-desktop-client.yml diff --git a/.gitea/workflows/windows-desktop-client.yml b/.gitea/workflows/windows-desktop-client.yml new file mode 100644 index 0000000..dd885ae --- /dev/null +++ b/.gitea/workflows/windows-desktop-client.yml @@ -0,0 +1,85 @@ +name: Build Windows Desktop Client + +on: + workflow_dispatch: + push: + branches: + - main + - master + paths: + - ".gitea/workflows/windows-desktop-client.yml" + - "desktop-client/**" + +jobs: + build-windows-client: + name: Build Windows Client + runs-on: + - self-hosted + - linux + + 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: x86_64-pc-windows-msvc + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + curl \ + wget \ + file \ + nsis \ + pkg-config \ + libssl-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + patchelf + + - name: Install cargo-xwin + run: | + if ! cargo xwin --version >/dev/null 2>&1; then + cargo install --locked cargo-xwin + fi + + - name: Install desktop client dependencies + run: npm install + + - name: Build bundled Windows tunnel helper + run: npm run helper:windows-x64 + + - name: Build Windows installer + run: npm run tauri:build:windows-x64:linux + + - name: Upload Windows installer + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: NexaVPN-windows-installer + path: | + desktop-client/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe + desktop-client/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.msi + if-no-files-found: error + + - name: Upload raw Windows build outputs + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: NexaVPN-windows-raw-build + path: | + desktop-client/src-tauri/target/x86_64-pc-windows-msvc/release/nexavpn-desktop.exe + desktop-client/src-tauri/bundled/windows-x64/nexavpn-tunnel-helper.exe + if-no-files-found: error