In professional engineering teams, developers never manually build APKs on their local laptops and email them to stakeholders. Continuous Integration and Continuous Deployment (CI/CD) automates the entire software release pipeline: executing unit tests on every pull request, enforcing code style rules, compiling signed Android App Bundles, and publishing them directly to the Google Play Store.
name: Android CI / CD Pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build & Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Java Development Kit (JDK 17)
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Grant Execute Permission for Gradle Wrapper
run: chmod +x gradlew
- name: Run Android Lint Check
run: ./gradlew lintDebug
- name: Run Local Unit Tests
run: ./gradlew testDebugUnitTest
- name: Build Release Android App Bundle (AAB)
run: ./gradlew bundleRelease
env:
SIGNING_KEY_STORE: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
KEY_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: app-release-bundle
path: app/build/outputs/bundle/release/app-release.aab
Broaden your foundational and advanced Android application development skills across our curriculum:
Execute automated unit tests and code coverage reports on pull requests.
Automate AAB generation and Play Console upload using Fastlane.
Manage build variants (debug, staging, release) in CI workflows.
Generate release bundles with full optimization and sign with secrets.