Build & Deploy Android Development to Google Play store #34
Workflow file for this run
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 & Deploy Android Development to Google Play store | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: JSON to variables | |
uses: antifree/[email protected] | |
with: | |
filename: 'config/development_version.json' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.19.3' | |
channel: 'stable' | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Configure Keystore | |
run: | | |
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks | |
echo "storeFile=upload-keystore.jks" >> key.properties | |
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties | |
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties | |
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties | |
env: | |
PLAY_STORE_UPLOAD_KEY: ${{ secrets.KEYSTORE }} | |
KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
working-directory: android | |
- name: Config demo user info | |
run: | | |
echo "demoServerUrl=$DEMO_SERVER_URL" >> assets/env/.env_demo | |
echo "demoUserName=$DEMO_USER_NAME" >> assets/env/.env_demo | |
echo "demoPassword=$DEMO_PASSWORD" >> assets/env/.env_demo | |
env: | |
DEMO_SERVER_URL: ${{ secrets.KEY_DEMO_SERVER_URL }} | |
DEMO_USER_NAME: ${{ secrets.KEY_DEMO_USER_NAME }} | |
DEMO_PASSWORD: ${{ secrets.KEY_DEMO_PASSWORD }} | |
- name: Play-Free release | |
run: flutter build apk --flavor dev --target lib/main_dev.dart --build-name ${{ env.VersionName }} --build-number ${{github.run_number}} | |
- name: Archive build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Android app develop APK | |
path: | | |
build/app/outputs/flutter-apk/*.apk | |
- name: Build abb release file | |
run: flutter build appbundle --flavor dev --target lib/main_dev.dart --build-name ${{ env.VersionName }} --build-number ${{github.run_number}} | |
- name: Upload to Play Store (Internal Testing) | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} | |
packageName: com.axonivy.dev | |
releaseFiles: build/app/outputs/bundle/devRelease/app-dev-release.aab | |
mappingFile: ./build/app/outputs/mapping/devRelease/mapping.txt | |
track: internal |