Build and deploy 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 and deploy apk | |
on: | |
workflow_dispatch: | |
inputs: | |
major_counter: | |
description: "App version major counter" | |
required: true | |
default: "1" | |
minor_counter: | |
description: "App version minor counter" | |
required: true | |
default: "0" | |
patch_counter: | |
description: "App version patch counter" | |
required: true | |
default: "6" | |
jobs: | |
Build_and_Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Output build counter | |
env: | |
MAJOR_COUNTER: ${{ github.event.inputs.major_counter }} | |
MINOR_COUNTER: ${{ github.event.inputs.minor_counter }} | |
PATCH_COUNTER: ${{ github.event.inputs.patch_counter }} | |
run: | | |
echo "Version: $MAJOR_COUNTER.$MINOR_COUNTER.PATCH_COUNTER" | |
- name: Set up Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install npm dependency | |
run: yarn install | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Decode and save keystore file | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
run: | | |
echo "$KEYSTORE_BASE64" | base64 -d > android/app/friendly_plans_upload.keystore | |
- name: Build release AAB | |
env: | |
KEYSTORE_PATH: ./friendly_plans_upload.keystore | |
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
MAJOR_COUNTER: ${{ github.event.inputs.major_counter }} | |
MINOR_COUNTER: ${{ github.event.inputs.minor_counter }} | |
PATCH_COUNTER: ${{ github.event.inputs.patch_counter }} | |
working-directory: ./android | |
run: | | |
./gradlew assembleRelease | |
- name: Upload release AAB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-apk | |
path: android/app/build/outputs/apk/release/app-release.apk |