Skip to content

Commit

Permalink
ci: add a workflow to build an APK
Browse files Browse the repository at this point in the history
  • Loading branch information
Wylwi committed Oct 11, 2024
1 parent 8af3a11 commit 14c01ee
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/artifact_building.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: Build with Gradle
run: ./gradlew assembleRelease --parallel

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app-release.apk
path: app/build/outputs/apk/release/app-release-unsigned.apk

0 comments on commit 14c01ee

Please sign in to comment.