ci(windows): use MSYS2 Perl for OpenSSL #28
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 APK | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Debug APK (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| cache: true | |
| cache-dependency-path: app/src/main/go/go.sum | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Setup Android NDK | |
| id: setup-ndk | |
| uses: nttld/setup-ndk@v1 | |
| with: | |
| ndk-version: r27c | |
| - name: Install build tools (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y cmake ninja-build meson | |
| # macos-latest is Apple Silicon and the NDK r27 toolchain is darwin-x86_64. | |
| # Install Rosetta 2 so the cross-compiler binaries can execute. | |
| - name: Install build tools (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| softwareupdate --install-rosetta --agree-to-license || true | |
| brew install cmake ninja meson | |
| - name: Set up MSYS2 Perl (Windows) | |
| if: runner.os == 'Windows' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| install: perl | |
| # Windows OpenSSL build runs through bash + GNU make. OpenSSL needs a | |
| # Unix-style Perl with the standard modules Git Bash's Perl omits. | |
| - name: Install build tools (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| choco install -y --no-progress make ninja meson | |
| "C:\Program Files\Meson" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| "OPENSSL_PERL=C:/msys64/usr/bin/perl.exe" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Cache third-party C deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: app/src/main/go/third_party/output | |
| key: third-party-${{ matrix.os }}-${{ hashFiles('app/src/main/go/third_party/CMakeLists.txt', 'app/src/main/go/build.sh', 'app/src/main/go/build.ps1') }} | |
| - name: Build with Gradle | |
| shell: bash | |
| run: ./gradlew assembleDebug --info --stacktrace | |
| env: | |
| ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| # Only upload from Linux. macOS/Windows runs are just verifying the build works. | |
| - name: Upload APK | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 14 |