Build Release APK #1
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: Build Release APK | |
on: | |
workflow_dispatch: | |
push: | |
tags: [ 'v*' ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Set up JDK 17 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
# Decode and write the signing key from secrets | |
- name: Decode signing key | |
run: echo "${{ secrets.SIGNING_KEY_BASE64 }}" | base64 -di > keystore.jks | |
# Build the APK | |
- name: Build APK | |
run: | | |
chmod +x ./gradlew | |
./gradlew assembleRelease | |
env: | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
# Sign the APK (Already handled by Gradle) | |
# Upload APK as artifact | |
- name: Upload Signed APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-release | |
path: app/build/outputs/apk/release/*.apk |