2022-03-24 18:42:44 +01:00
|
|
|
name: Make Apk CI
|
2022-02-14 00:42:41 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2022-03-24 18:42:44 +01:00
|
|
|
Build-Apk:
|
2022-03-27 16:08:26 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-02-14 00:42:41 +01:00
|
|
|
steps:
|
2022-10-16 00:53:04 +02:00
|
|
|
- uses: actions/setup-java@v3
|
2022-03-24 02:44:17 +01:00
|
|
|
with:
|
|
|
|
distribution: 'zulu' # See 'Supported distributions' for available options
|
2023-11-25 20:11:12 +01:00
|
|
|
java-version: '17'
|
2022-03-25 00:24:33 +01:00
|
|
|
- name: Checkout repo
|
2022-10-16 00:53:04 +02:00
|
|
|
uses: actions/checkout@v3
|
2023-11-25 20:11:12 +01:00
|
|
|
- name: Restore debug keystore from GitHub Secrets
|
2022-04-02 16:33:12 +02:00
|
|
|
run: |
|
|
|
|
# Check if exist and use the secret named DEBUG_KEYSTORE
|
|
|
|
# The contents of the secret can be obtained -
|
2023-11-25 20:11:12 +01:00
|
|
|
# from the debug.keystore.asc from you local folder (refer to CONTRIBUTING.md#Using the local debug.keystore on the Github CI actions)
|
2022-04-24 20:52:36 +02:00
|
|
|
if [[ ! "${{ secrets.DEBUG_KEYSTORE }}" = "" ]]; then
|
2022-04-02 16:33:12 +02:00
|
|
|
echo "${{ secrets.DEBUG_KEYSTORE }}" > "debug.keystore.asc"
|
|
|
|
if [[ -s "debug.keystore.asc" ]]; then
|
2023-11-25 20:11:12 +01:00
|
|
|
echo "Restoring debug keystore from GitHub secrets"
|
2022-04-02 16:33:12 +02:00
|
|
|
gpg -d --passphrase "debug0" --batch "debug.keystore.asc" > "debug.keystore"
|
|
|
|
fi
|
|
|
|
fi
|
2023-11-25 20:11:12 +01:00
|
|
|
- name: Build debug APK
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
env:
|
|
|
|
DEBUG_KEYSTORE: "debug.keystore"
|
|
|
|
DEBUG_KEYSTORE_PASSWORD: debug0
|
|
|
|
DEBUG_KEY_ALIAS: debug
|
|
|
|
DEBUG_KEY_PASSWORD: debug0
|
|
|
|
with:
|
|
|
|
arguments: assembleDebug
|
2022-10-16 00:53:04 +02:00
|
|
|
- name: Artifact naming
|
|
|
|
run: |
|
|
|
|
artifact="${{github.repository_owner}} ${{github.ref_name}}"
|
|
|
|
artifact="${artifact//\//-}" # replace slashes
|
|
|
|
echo "artifact=${artifact}" >> $GITHUB_ENV
|
2023-11-25 20:11:12 +01:00
|
|
|
- name: Upload debug APK
|
2022-10-16 00:53:04 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-14 00:42:41 +01:00
|
|
|
with:
|
2022-10-16 00:53:04 +02:00
|
|
|
name: "${{env.artifact}} debug_apk"
|
2023-11-25 20:11:12 +01:00
|
|
|
path: build/outputs/apk/debug/*.apk
|