Skip to content

Modified release feature workflow #10

Modified release feature workflow

Modified release feature workflow #10

name: Release Build
on:
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Android project
uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle Cache
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > app/keystore.jks.b64
base64 -d -i app/keystore.jks.b64 > app/keystore.jks
echo "keystoreFile=app/keystore.jks" >> signing.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> signing.properties
echo "keystorePassword=$KEYSTORE_STORE_PASSWORD" >> signing.properties
echo "::debug::storePassword=$KEYSTORE_STORE_PASSWORD"
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> signing.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease bundleRelease
- name: Get AAB file path
id: aab-path
run: echo "path=$(find . -regex '^.*/build/outputs/bundle/release/*\.aab$' -type f | head -1)" >> $GITHUB_OUTPUT
- name: Upload AAB file to Artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ steps.aab-path.outputs.path }}
- name: Generate Universal APK file
uses: snnaplab/universal-apk-generate-action@v1
id: apk-generate
with:
aab-path: ${{ steps.aab-path.outputs.path }}
keystore-base64: ${{ secrets.KEYSTORE_FILE }}
keystore-password: ${{ secrets.KEYSTORE_PASSWORD }}
key-alias: ${{ secrets.KEY_ALIAS }}
key-password: ${{ secrets.KEY_PASSWORD }}
- name: Upload APK file to Artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ steps.apk-generate.outputs.apk-path }}