Build APK #2
This file contains 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 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 }} | |
run: | | |
echo "$GOOGLE_SERVICES" | base64 --decode > ./app/google-services.json | |
- 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-unsigned.apk | |