update workflow #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ 'main', 'rel/**' ] | |
pull_request: | |
branches: [ 'main' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out branch | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: gradle | |
- 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: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: Decode Keystore | |
env: | |
ENCODED_STRING: ${{ secrets.KEYSTORE }} | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }} | |
run: | | |
echo "$ENCODED_STRING" > keystore-b64.txt | |
base64 -d keystore-b64.txt > app/OpenMobileNetworkToolkit-key.jks && ls -la app | |
mkdir android | |
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 | |
- 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 | |
- 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 }} |