Build Android AAB #6
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 Android AAB | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: android | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| # Checksums the committed wrapper jar against Gradle's known-good | |
| # release hashes, so a tampered wrapper fails the build instead of | |
| # silently running. | |
| - uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 | |
| - uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| # @bubblewrap/cli is declared as a devDependency with a committed | |
| # lockfile in .github/tools/android, so this installs a pinned, | |
| # hash-verified version instead of resolving a version string at | |
| # runtime. | |
| - name: Install Bubblewrap | |
| working-directory: .github/tools/android | |
| run: npm install | |
| # bubblewrap prompts interactively for JDK/SDK paths on first run | |
| # (Cli.ts's loadOrCreateConfig), which hangs on a non-TTY runner. | |
| # Pre-seeding the config with the paths setup-java/setup-android | |
| # already installed skips that prompt entirely. | |
| - name: Configure Bubblewrap JDK/SDK paths | |
| run: | | |
| mkdir -p ~/.bubblewrap | |
| echo "{\"jdkPath\":\"$JAVA_HOME\",\"androidSdkPath\":\"$ANDROID_HOME\"}" > ~/.bubblewrap/config.json | |
| - name: Decode keystore | |
| run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > "$RUNNER_TEMP/keystore.jks" | |
| - name: Build release AAB | |
| env: | |
| BUBBLEWRAP_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| BUBBLEWRAP_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: | | |
| "$GITHUB_WORKSPACE/.github/tools/android/node_modules/.bin/bubblewrap" build --skipPwaValidation \ | |
| --signingKeyPath="$RUNNER_TEMP/keystore.jks" \ | |
| --signingKeyAlias="video-shrinker" | |
| - name: Upload AAB | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: video-shrinker-${{ github.run_number }} | |
| path: | | |
| android/app-release-bundle.aab | |
| android/app-release-signed.apk | |
| if-no-files-found: warn | |
| retention-days: 90 |