Android Build Release FOSS APK #107
This file contains hidden or 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 Build Release FOSS APK | |
| on: | |
| push: | |
| branches: | |
| - 'develop' | |
| paths: | |
| - 'version.properties' | |
| workflow_dispatch: | |
| inputs: | |
| single_apk: | |
| description: 'Build only the universal apk' | |
| type: boolean | |
| env: | |
| BRANCH_NAME: ${{ github.base_ref || github.ref_name }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Decode Keystore File | |
| uses: timheuer/base64-to-file@v1 | |
| id: android_keystore | |
| with: | |
| fileName: "android_keystore.keystore" | |
| encodedString: ${{secrets.KEYSTORE_FILE}} | |
| - name: Accept Android SDK license | |
| run: echo "y" | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0" | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: adopt | |
| - if: ${{ inputs.single_apk == true || env.BRANCH_NAME == 'develop' }} | |
| run: sed -i -e '/isEnable/s/true/false/' app/build.gradle.kts | |
| - name: Build Android release | |
| run: fastlane release | |
| env: | |
| KEYSTORE_FILE: ${{steps.android_keystore.outputs.filePath}} | |
| KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} | |
| KEY_ALIAS: ${{secrets.KEY_ALIAS}} | |
| KEY_PASSWORD: ${{secrets.KEY_PASSWORD}} | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: assets | |
| path: ${{github.workspace}}/app/build/outputs/apk/foss/release/*.apk |