Skip to content
name: Android - Deploy Production build to Play Store
on:
push:
branches:
- main
- chore/226-update-secrets-management
jobs:
build_and_deploy_android:
name: Build & Deploy Android
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Set up Flutter environment
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.10.5'
- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks sample
- name: Get Flutter dependencies
run: flutter pub get
- name: Run code generator
run: flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Set up .env
env:
ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }}
run: |
echo -e $ENV_PRODUCTION > .env
- name: Set up release signing configs
env:
ANDROID_RELEASE_KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}
ANDROID_SIGNING_PROPERTIES: ${{ secrets.ANDROID_SIGNING_PROPERTIES }}
run: |
echo $ANDROID_RELEASE_KEYSTORE_BASE64 | base64 --decode > android/config/release.keystore
echo -e $ANDROID_SIGNING_PROPERTIES > android/signing.properties
cat .env
cat android/signing.properties
- name: Build Production App Bundle
run: flutter build appbundle --flavor production --release --build-number $GITHUB_RUN_NUMBER
# TODO We will enable this step later when having a shared Service Account on our organization
# Basically, this step will work properly after providing a valid Service Account.
# - name: Upload Android Production Release bundle to Play Store
# uses: r0adkll/upload-google-play@v1
# with:
# serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
# packageName: co.nimblehq.flutter.template
# releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab
# track: internal
# userFraction: 1.0
# whatsNewDirectory: .github/workflows/whatsnew