|
| 1 | +name: Android Reproducible Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + variant: |
| 7 | + description: Release APK variant to verify |
| 8 | + required: true |
| 9 | + default: universal |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - fdroid |
| 13 | + - universal |
| 14 | + pull_request: |
| 15 | + branches: ["main"] |
| 16 | + paths: |
| 17 | + - "android/app/build.gradle.kts" |
| 18 | + - "android/**/*.gradle.kts" |
| 19 | + - "android/app/proguard*.pro" |
| 20 | + - "android/fdroid-build/**" |
| 21 | + - "android/reproducible/**" |
| 22 | + - "android/gradle/**" |
| 23 | + - "shell.nix" |
| 24 | + - ".github/workflows/android-reproducible.yml" |
| 25 | + push: |
| 26 | + paths: |
| 27 | + - "android/app/build.gradle.kts" |
| 28 | + - "android/**/*.gradle.kts" |
| 29 | + - "android/app/proguard*.pro" |
| 30 | + - "android/fdroid-build/**" |
| 31 | + - "android/reproducible/**" |
| 32 | + - "android/gradle/**" |
| 33 | + - "shell.nix" |
| 34 | + - ".github/workflows/android-reproducible.yml" |
| 35 | + |
| 36 | +concurrency: |
| 37 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 38 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 39 | + |
| 40 | +jobs: |
| 41 | + verify: |
| 42 | + name: Verify ${{ github.event.inputs.variant || 'universal' }} APK |
| 43 | + runs-on: ubuntu-latest |
| 44 | + timeout-minutes: 180 |
| 45 | + env: |
| 46 | + GPR_USERNAME: ${{ github.actor }} |
| 47 | + GPR_TOKEN: ${{ github.token }} |
| 48 | + NIX_PATH: nixpkgs=https://github.com/NixOS/nixpkgs/archive/c7f47036d3df2add644c46d712d14262b7d86c0c.tar.gz |
| 49 | + REPRO_VARIANT: ${{ github.event.inputs.variant || 'universal' }} |
| 50 | + steps: |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@v5 |
| 53 | + with: |
| 54 | + submodules: recursive |
| 55 | + |
| 56 | + - name: Free hosted runner disk |
| 57 | + run: | |
| 58 | + df -h |
| 59 | + sudo rm -rf \ |
| 60 | + "$ANDROID_HOME" \ |
| 61 | + "$ANDROID_SDK_ROOT" \ |
| 62 | + /usr/local/lib/android \ |
| 63 | + /opt/hostedtoolcache \ |
| 64 | + /usr/share/dotnet \ |
| 65 | + /usr/local/share/boost \ |
| 66 | + /usr/local/.ghcup \ |
| 67 | + /opt/ghc \ |
| 68 | + /var/lib/docker |
| 69 | + sudo apt-get clean |
| 70 | + df -h |
| 71 | +
|
| 72 | + - name: Install Nix |
| 73 | + uses: cachix/install-nix-action@v31 |
| 74 | + |
| 75 | + - name: Verify reproducible APK |
| 76 | + run: | |
| 77 | + nix-shell shell.nix --run \ |
| 78 | + "android/reproducible/verify.sh --source . --variant $REPRO_VARIANT --work-dir $RUNNER_TEMP/gem-repro --keep" |
| 79 | +
|
| 80 | + - name: Upload verifier artifacts |
| 81 | + if: failure() |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: android-reproducible-${{ env.REPRO_VARIANT }} |
| 85 | + path: | |
| 86 | + ${{ runner.temp }}/gem-repro/build-one/*.apk |
| 87 | + ${{ runner.temp }}/gem-repro/build-two/*.apk |
| 88 | + ${{ runner.temp }}/gem-repro/build-one/build.log |
| 89 | + ${{ runner.temp }}/gem-repro/build-two/build.log |
| 90 | + ${{ runner.temp }}/gem-repro/build-one/*mapping*.txt |
| 91 | + ${{ runner.temp }}/gem-repro/build-two/*mapping*.txt |
| 92 | + ${{ runner.temp }}/gem-repro/build-one/*configuration*.txt |
| 93 | + ${{ runner.temp }}/gem-repro/build-two/*configuration*.txt |
| 94 | + ${{ runner.temp }}/gem-repro/*.html |
0 commit comments