-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|