Skip to content
Latchkey

How to Build an Android APK or AAB in CI

assembleRelease produces an APK; bundleRelease produces an AAB, the format Google Play requires for new apps.

Provision a JDK with actions/setup-java, then run the Gradle wrapper. Use bundleRelease for a Play upload (.aab) or assembleRelease for a directly installable .apk.

Steps

  • Check out the repo and set up a JDK (Temurin 17 for recent Android Gradle Plugin).
  • Run ./gradlew bundleRelease (or assembleRelease) from the project root.
  • Upload the output under app/build/outputs/ as a build artifact.

Workflow

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: '17'
      - run: chmod +x gradlew && ./gradlew bundleRelease
      - uses: actions/upload-artifact@v4
        with:
          name: app-release-aab
          path: app/build/outputs/bundle/release/app-release.aab

Gotchas

  • An unsigned bundleRelease produces app-release.aab only if signing is wired; otherwise you get app-release-unsigned.
  • Cache the Gradle home to avoid re-downloading dependencies on every run.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →