Skip to content

Build APK

Build APK #11

name: Build APK
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# Load google-services.json from the secrets
- name: Decode secrets
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
KEYSTORE: ${{ secrets.KEYSTORE }}
run: |
echo "$GOOGLE_SERVICES" | base64 --decode > ./app/google-services.json
echo "$KEYSTORE_PROPERTIES" | base64 --decode > ./keystore.properties
echo "$KEYSTORE" | base64 --decode > ./keystore.jks
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
# Caching is a very useful part of a CI, as a workflow is executed in a clean environment every time,
# this means that one would need to re-download and re-process gradle files for every run. Which is very time consuming.
#
# To avoid that, we cache the the gradle folder to reuse it later.
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Grant execute permission for gradlew
run: |
chmod +x ./gradlew
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Build with Gradle
run: ./gradlew assembleRelease lint --parallel
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: app/build/outputs/apk/release/app-release.apk