Fix MTU handling and Windows GUI buttons #291
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Clients | |
| on: | |
| push: | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # ── Linux CLI ──────────────────────────────────────────────────────────────── | |
| linux-cli: | |
| name: Linux CLI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: linux-cli-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: linux-cli-cargo- | |
| - name: Install build dependencies | |
| run: sudo apt-get update -q && sudo apt-get install -y cmake pkg-config rpm | |
| - name: Build | |
| run: cargo build --release -p linux-vpn | |
| - name: Install FPM | |
| run: sudo gem install fpm | |
| - name: Package DEB and RPM | |
| run: | | |
| VERSION="0.1.0" | |
| mkdir -p dist | |
| fpm -s dir -t deb -n mavi-vpn-cli -v $VERSION \ | |
| --after-install gui/src-tauri/linux/postinst \ | |
| --before-remove gui/src-tauri/linux/prerm \ | |
| --conflicts mavi-vpn \ | |
| --replaces mavi-vpn \ | |
| --description "Mavi VPN Background Service" \ | |
| -p dist/mavi-vpn-cli_${VERSION}_amd64.deb \ | |
| target/release/mavi-vpn=/usr/local/bin/mavi-vpn \ | |
| linux/mavi-vpn.service=/lib/systemd/system/mavi-vpn.service | |
| fpm -s dir -t rpm -n mavi-vpn-cli -v $VERSION \ | |
| --after-install gui/src-tauri/linux/postinst \ | |
| --before-remove gui/src-tauri/linux/prerm \ | |
| --conflicts mavi-vpn \ | |
| --description "Mavi VPN Background Service" \ | |
| -p dist/mavi-vpn-cli-${VERSION}-1.x86_64.rpm \ | |
| target/release/mavi-vpn=/usr/local/bin/mavi-vpn \ | |
| linux/mavi-vpn.service=/lib/systemd/system/mavi-vpn.service | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-cli | |
| path: | | |
| target/release/mavi-vpn | |
| dist/*.deb | |
| dist/*.rpm | |
| # ── Android APK ────────────────────────────────────────────────────────────── | |
| android-apk: | |
| name: Android APK | |
| runs-on: ubuntu-latest | |
| env: | |
| NDK_VERSION: 28.1.13356709 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Install Android NDK | |
| run: | | |
| echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;${NDK_VERSION}" | |
| echo "ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION}" >> $GITHUB_ENV | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| ~/.cargo/bin/cargo-ndk | |
| target/ | |
| key: android-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: android-cargo- | |
| - name: Install cargo-ndk | |
| run: which cargo-ndk || cargo install cargo-ndk --locked | |
| - name: Build APK (debug) | |
| working-directory: android | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew assembleDebug | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: android/app/build/outputs/apk/debug/*.apk | |
| # ── Linux GUI (Tauri) ───────────────────────────────────────────────────────── | |
| linux-gui: | |
| name: Linux GUI (Tauri) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: linux-gui-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: linux-gui-cargo- | |
| - name: Install Tauri system dependencies | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| build-essential \ | |
| cmake \ | |
| pkg-config \ | |
| libssl-dev \ | |
| libglib2.0-dev \ | |
| libxdo-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev | |
| - name: Build Linux CLI & Service | |
| run: cargo build --release -p linux-vpn | |
| - name: Install npm dependencies | |
| working-directory: gui | |
| run: npm install | |
| - name: Build Tauri app | |
| working-directory: gui | |
| run: npm run tauri -- build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-gui | |
| path: | | |
| target/release/bundle/deb/*.deb | |
| target/release/bundle/rpm/*.rpm | |
| # ── Windows GUI (Tauri) ─────────────────────────────────────────────────────── | |
| windows-gui: | |
| name: Windows GUI (Tauri) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: windows-gui-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: windows-gui-cargo- | |
| - name: Build Windows CLI & Service | |
| run: cargo build --release -p windows-vpn | |
| - name: Stage binaries for WiX | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "gui\src-tauri\wix_binaries" | Out-Null | |
| Copy-Item "target\release\mavi-vpn-client.exe" "gui\src-tauri\wix_binaries\mavi-vpn-client.exe" | |
| Copy-Item "target\release\mavi-vpn-service.exe" "gui\src-tauri\wix_binaries\mavi-vpn-service.exe" | |
| Write-Host "Binaries staged." | |
| - name: Patch service.wxs with absolute paths | |
| shell: pwsh | |
| run: | | |
| $clientPath = (Resolve-Path "gui\src-tauri\wix_binaries\mavi-vpn-client.exe").Path | |
| $servicePath = (Resolve-Path "gui\src-tauri\wix_binaries\mavi-vpn-service.exe").Path | |
| $wxs = Get-Content "gui\src-tauri\wix\service.wxs" -Raw | |
| $wxs = $wxs -replace '__CLIENT_EXE_PATH__', $clientPath | |
| $wxs = $wxs -replace '__SERVICE_EXE_PATH__', $servicePath | |
| Set-Content "gui\src-tauri\wix\service.wxs" $wxs | |
| Write-Host "service.wxs patched." | |
| - name: Install npm dependencies | |
| working-directory: gui | |
| run: npm install | |
| - name: Build Tauri app (NSIS + MSI) | |
| working-directory: gui | |
| run: npm run tauri -- build --bundles nsis,msi | |
| - name: Restore service.wxs template | |
| if: always() | |
| shell: pwsh | |
| run: | | |
| $wxs = Get-Content "gui\src-tauri\wix\service.wxs" -Raw | |
| $wxs = $wxs -replace 'Source="[^"]*mavi-vpn-client\.exe"', 'Source="__CLIENT_EXE_PATH__"' | |
| $wxs = $wxs -replace 'Source="[^"]*mavi-vpn-service\.exe"', 'Source="__SERVICE_EXE_PATH__"' | |
| Set-Content "gui\src-tauri\wix\service.wxs" $wxs | |
| Write-Host "service.wxs restored." | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-builds | |
| path: | | |
| target/release/bundle/nsis/*.exe | |
| target/release/bundle/msi/*.msi | |
| target/release/mavi-vpn-client.exe | |
| target/release/mavi-vpn-service.exe | |
| windows/wintun.dll | |