-
-
Notifications
You must be signed in to change notification settings - Fork 98
71 lines (70 loc) · 2.41 KB
/
build-aab.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
on:
workflow_call:
outputs:
filename:
description: "artifact file name"
value: ${{ jobs.build-aab.outputs.filename }}
secrets:
key-alias:
required: false
keystore:
required: false
key-password:
required: false
jobs:
build-aab:
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build_aab.outputs.upload_filename }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
/usr/local/lib/android
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties' )}}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up OpenJDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install required platform
run: sdkmanager "platforms;android-34" "build-tools;34.0.0"
- name: Replace android.jar
run: |
curl -L https://github.com/Reginer/aosp-android-jar/raw/main/android-34/android.jar > /usr/local/lib/android/sdk/platforms/android-34/android.jar
- name: Build App Bundle
id: build_aab
run: |
./gradlew bundleRelease
echo "upload_filename=${RUN_ID}-AAB" >> $GITHUB_OUTPUT
env:
RUN_ID: ${{ github.run_id }}
- name: Save keystore as file
run: echo "${KEYSTORE_B64}" | base64 -d > keystore.jks
env:
KEYSTORE_B64: ${{ secrets.keystore }}
- name: Sign APK
run: |
echo "${KEY_PASSWORD}" | \
$ANDROID_SDK_ROOT/build-tools/34.0.0/apksigner sign \
--ks keystore.jks --ks-key-alias "${KEY_ALIAS}" \
--key-pass "env:KEY_PASSWORD" \
--out dev.bluehouse.enablevolte.aab \
--min-sdk-version $(cat app/build.gradle | grep minSdk | awk '{print $2}') \
app/build/outputs/bundle/release/app-release.aab
env:
KEY_ALIAS: ${{ secrets.key-alias }}
KEY_PASSWORD: ${{ secrets.key-password }}
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build_aab.outputs.upload_filename }}
path: dev.bluehouse.enablevolte.aab
retention-days: 3