Skip to content

Build Android

Build Android #47

Workflow file for this run

name: Build Android
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Android Keystore
id: android_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'yaga.jks'
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.3'
channel: 'stable'
cache: false
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- run: flutter build appbundle --flavor play
- uses: actions/upload-artifact@v3
with:
name: app-play-release.aab
path: ./build/app/outputs/bundle/playRelease/app-play-release.aab
- name: Convert aab to apk
id: convert_aab
uses: mukeshsolanki/bundletool-action@v1.0.2
with:
aabFile: ./build/app/outputs/bundle/playRelease/app-play-release.aab
base64Keystore: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
keystorePassword: ${{ secrets.STORE_PASSWORD }}
keystoreAlias: ${{ secrets.KEY_ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
bundletoolVersion: '1.15.6'
- uses: actions/upload-artifact@v3
with:
name: app-play-release.apk
path: ${{ steps.convert_aab.outputs.apkPath }}
internal:
needs: build
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'internal'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
alpha:
needs: internal
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'alpha'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
github:
needs: internal
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'github'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
beta:
needs: alpha
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'beta'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}