Skip to content

Build Android Release Package #3

Build Android Release Package

Build Android Release Package #3

Workflow file for this run

name: Build Android Release Package
on:
workflow_dispatch:
jobs:
android-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Create Sekrets
run: |
./gradlew createSekretProperties -Pkey=GITHUB_CLIENT_ID -Pvalue=${{ secrets.GH_CLIENT_ID }};
./gradlew createSekretProperties -Pkey=GITHUB_CLIENT_SECRET -Pvalue=${{ secrets.GH_CLIENT_SECRET }};
./gradlew createSekretProperties -Pkey=FIREBASE_PROJECT -Pvalue=${{ secrets.FIREBASE_PROJECT }};
./gradlew createSekretProperties -Pkey=FIREBASE_APPLICATION -Pvalue=${{ secrets.FIREBASE_APPLICATION }};
./gradlew createSekretProperties -Pkey=FIREBASE_API_KEY -Pvalue=${{ secrets.FIREBASE_API_KEY }}
- name: Generate Sekret binary
run: ./gradlew composeApp:createSekretNativeBinary
- name: Copy Sekrets
run: ./gradlew composeApp:copySekretNativeBinary
- name: Build
continue-on-error: true
run: ./gradlew build
- name: Execute Build
run: ./gradlew composeApp:assembleRelease && ./gradlew composeApp:bundleRelease
- name: Move APK file(s)
run: mv ./composeApp/build/outputs/apk/release/*.apk ./composeApp/release/
- name: Move AAB file(s)
run: mv ./composeApp/build/outputs/bundle/release/*.aab ./composeApp/release/
- name: Remove "-unsigned" from filename(s)
run: for filename in ./composeApp/release/*-unsigned*; do mv "./$filename" "./$(echo "$filename" | sed -e 's/-unsigned//g')"; done
- uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: composeApp/release
signingKey: ${{ secrets.ANDROID_SIGNING_KEY }}
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Split signed files
uses: xom9ikk/split@v1
id: split
with:
string: ${{ steps.sign_app.outputs.signedFiles }}
separator: ':'
limit: 2
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: |
${{ steps.split.outputs._0 }}
${{ steps.split.outputs._1 }}
retention-days: 1