Unexpected-Keyboard/.github/workflows/make-apk.yml

49 lines
1.7 KiB
YAML
Raw Normal View History

name: Make Apk CI
on:
workflow_dispatch:
push:
pull_request:
jobs:
Build-Apk:
runs-on: ubuntu-latest
steps:
- 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'
- name: Checkout repo
uses: actions/checkout@v3
2023-11-25 20:11:12 +01:00
- name: Restore debug keystore from GitHub Secrets
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)
if [[ ! "${{ secrets.DEBUG_KEYSTORE }}" = "" ]]; then
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"
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
- 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
uses: actions/upload-artifact@v3
with:
name: "${{env.artifact}} debug_apk"
2023-11-25 20:11:12 +01:00
path: build/outputs/apk/debug/*.apk