Skip to content

Merge pull request #281 from nimblehq/chore/198-test-merge-staging-pr… #109

Merge pull request #281 from nimblehq/chore/198-test-merge-staging-pr…

Merge pull request #281 from nimblehq/chore/198-test-merge-staging-pr… #109

name: Android - Deploy Staging build to Firebase
on:
push:
branches:
- develop
- chore/198-test-merge-2
jobs:
build_and_deploy_android:
name: Android - Deploy Staging build to Firebase
runs-on: ubuntu-latest
environment: staging
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
- 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.staging
env:
ENV: ${{ secrets.ENV }}
run: |
echo -e "$ENV" > .env.staging
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER
- name: Find HEAD commit
id: head
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Limit changelog to the latest pull request only
uses: jossef/action-set-json-field@v2
with:
file: .github/workflows/configs/changelog-config.json
field: max_pull_requests
value: 1
- name: Build changelog on "develop"
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: ".github/workflows/configs/changelog-config.json"
# Listing PRs from the last tag to the HEAD commit
toTag: ${{ steps.head.outputs.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Android Staging to Firebase
uses: wzieba/[email protected]
with:
appId: ${{ vars.FIREBASE_ANDROID_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }}
releaseNotes: ${{ steps.changelog.outputs.changelog }}
file: build/app/outputs/flutter-apk/app-staging-debug.apk