Skip to content

crashlytics implementation #10

crashlytics implementation

crashlytics implementation #10

name: Build & Distribute UAT
on:
push:
branches: [ main, develop ]
workflow_dispatch: # Manual trigger
jobs:
build-and-distribute:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create local.properties
run: echo "sdk.dir=$ANDROID_HOME" > local.properties
- name: Create google-services.json (UAT)
run: |
mkdir -p app/src/stoptbUat
echo '${{ secrets.GOOGLE_SERVICES_JSON_UAT }}' > app/src/stoptbUat/google-services.json
- name: Create google-services.json (Prod)
run: |
mkdir -p app/src/stoptb
echo '${{ secrets.GOOGLE_SERVICES_JSON_PROD }}' > app/src/stoptb/google-services.json
- name: Accept SDK licenses
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
- name: Install NDK
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;29.0.14033849"
- name: Build UAT Debug APK
run: ./gradlew assembleStoptbUatDebug --no-daemon
- name: Upload APK as artifact
uses: actions/upload-artifact@v4
with:
name: uat-debug-apk
path: app/build/outputs/apk/stoptbUat/debug/*.apk
- name: Distribute to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID_UAT }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
groups: testers
file: app/build/outputs/apk/stoptbUat/debug/app-stoptbUat-debug.apk
releaseNotes: |
Branch: ${{ github.ref_name }}
Commit: ${{ github.sha }}
Message: ${{ github.event.head_commit.message }}