Update build plugin version #69
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: Publish | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Grand execute permissions to gradlew | |
run: chmod +x gradlew | |
- name: Run unit tests | |
run: ./gradlew testDebug | |
apk: | |
name: Generate APK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Assemble app debug APK | |
run: ./gradlew assembleDebug | |
- name: Upload app APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-debug | |
path: app/build/outputs/apk/debug/app-debug.apk | |
- name: Assemble app instrumentation tests | |
run: ./gradlew assembleDebugAndroidTest | |
- name: Upload app test APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-debug-androidTest | |
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk | |
firebase: | |
name: Run UI tests with Firebase Test Lab | |
needs: apk | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download app APK | |
uses: actions/download-artifact@v1 | |
with: | |
name: app-debug | |
- name: Download app test APK | |
uses: actions/download-artifact@v1 | |
with: | |
name: app-debug-androidTest | |
- id: Auth | |
uses: google-github-actions/auth@v0 | |
with: | |
project_id: ${{ secrets.FRIENDS_PROJECT_ID }} | |
credentials_json: ${{ secrets.FRIENDS_FIREBASE_TEST_LAB_AUTH }} | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: Use gcloud CLI | |
run: gcloud info | |
- name: Run instrumentation tests in Firebase Test Lab | |
run: gcloud firebase test android run --type instrumentation --app app-debug/app-debug.apk --test app-debug-androidTest/app-debug-androidTest.apk --device model=blueline,version=28 | |
distribute: | |
name: Distribute app bundle to Play Store | |
needs: firebase | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Version bump | |
uses: chkfung/[email protected] | |
with: | |
gradlePath: app/build.gradle | |
versionCode: ${{ github.run_number }} | |
- name: Assemble Release Bundle | |
run: ./gradlew bundleRelease | |
- name: Sign Release | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/bundle/release | |
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} | |
alias: ${{ secrets.FRIENDS_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
keyPassword: ${{ secrets.FRIENDS_KEY_PASSWORD }} | |
- name: Setup authorization with Google Play Store | |
run: echo '${{ secrets.GOOGLE_SERVICES_API }}' > service_account.json | |
- name: Deploy to alpha | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJson: service_account.json | |
packageName: nl.jovmit.friends | |
releaseFiles: app/build/outputs/bundle/release/app-release.aab | |
track: alpha | |
status: 'completed' | |
whatsNewDirectory: whatsNewDirectory/ |