-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (73 loc) · 2.7 KB
/
android.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
72
73
74
75
76
77
78
79
80
81
name: Android CI
on:
push:
branches: [ 'main', 'rel/**' ]
pull_request:
branches: [ 'main' ]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout Branch ${{ github.ref }}
uses: actions/checkout@v4
- name: Get Latest iPerf
run: |
wget -O jniLibs.zip https://github.com/omnt/iperf/releases/latest/download/jniLibs
unzip jniLibs.zip -d app/src/main
rm jniLibs.zip
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.STOREPASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEYPASSWORD }}
run: |
sudo apt install coreutils
base64 --version
echo "$ENCODED_STRING" | base64 -d > OpenMobileNetworkToolkit-key.jks
mv OpenMobileNetworkToolkit-key.jks app
mkdir android
touch android/key.properties
echo "storePassword=$RELEASE_KEYSTORE_PASSWORD" > android/key.properties
echo "keyPassword=$RELEASE_KEY_PASSWORD" >> android/key.properties
echo "keyAlias=$RELEASE_KEYSTORE_ALIAS" >> android/key.properties
echo "storeFile=OpenMobileNetworkToolkit-key.jks" >> android/key.properties
build:
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Build APK
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }}
run: ./gradlew assembleRelease --stacktrace
- name: Build Bundle
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }}
run: ./gradlew bundleRelease --stacktrace
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get release file aab path
id: releaseAab
run: echo "aabfile=$(find app/build/outputs/bundle/release/*.aab)" >> $GITHUB_OUTPUT
- name: Get release file apk path
id: releaseApk
run: echo "apkfile=$(find app/build/outputs/apk/release/*.apk)" >> $GITHUB_OUTPUT
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: ${{ steps.releaseApk.outputs.apkfile }}