-
-
Notifications
You must be signed in to change notification settings - Fork 192
49 lines (47 loc) · 1.67 KB
/
make-apk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Make Apk CI
on:
workflow_dispatch:
push:
pull_request:
jobs:
Build-Apk:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Checkout repo
uses: actions/checkout@v4
- 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 -
# 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
echo "Restoring debug keystore from GitHub secrets"
gpg -d --passphrase "debug0" --batch "debug.keystore.asc" > "debug.keystore"
fi
fi
- name: Build debug APK
uses: gradle/gradle-build-action@v3
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
- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: "${{env.artifact}} debug_apk"
path: build/outputs/apk/debug/*.apk