From 75dfcfd903bee0bcde310bce885b808e6dba249f Mon Sep 17 00:00:00 2001 From: mpbw2 <59324545+mpbw2@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:50:07 +0000 Subject: [PATCH] [PM-38570] Testharness Firebase distribution (#7274) --- .github/workflows/build-testharness.yml | 34 +++++++++++++++++++++++++ fastlane/Fastfile | 16 ++++++++++++ 2 files changed, 50 insertions(+) diff --git a/.github/workflows/build-testharness.yml b/.github/workflows/build-testharness.yml index 61700279f6..2a53279fcd 100644 --- a/.github/workflows/build-testharness.yml +++ b/.github/workflows/build-testharness.yml @@ -4,6 +4,9 @@ on: push: paths: - testharness/** + branches: + - main + - release/**/* workflow_dispatch: inputs: version-name: @@ -17,9 +20,16 @@ on: patch_version: description: "Order 999 - Overrides Patch version" type: boolean + distribute-to-firebase: + description: "Optional. Distribute artifacts to Firebase." + required: false + default: true + type: boolean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_ACTION_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + DISTRIBUTE_TO_FIREBASE: ${{ inputs.distribute-to-firebase || github.event_name == 'push' }} permissions: contents: read @@ -78,6 +88,17 @@ jobs: az storage blob download --account-name "$ACCOUNT_NAME" --container-name "$CONTAINER_NAME" \ --name testharness_apk-keystore.jks --file ${{ github.workspace }}/keystores/testharness_apk-keystore.jks --output none + - name: Download Firebase credentials + if: ${{ env.DISTRIBUTE_TO_FIREBASE == 'true' }} + env: + ACCOUNT_NAME: bitwardenci + CONTAINER_NAME: mobile + run: | + mkdir -p ${{ github.workspace }}/secrets + + az storage blob download --account-name "$ACCOUNT_NAME" --container-name "$CONTAINER_NAME" \ + --name app_play_dev_firebase-creds.json --file ${{ github.workspace }}/secrets/app_play_dev_firebase-creds.json --output none + - name: AZ Logout uses: bitwarden/gh-actions/azure-logout@main @@ -119,3 +140,16 @@ jobs: name: com.bitwarden.testharness.apk-sha256.txt path: ./com.bitwarden.testharness.apk-sha256.txt if-no-files-found: error + + - name: Install Firebase app distribution plugin + if: ${{ env.DISTRIBUTE_TO_FIREBASE == 'true' }} + run: bundle exec fastlane add_plugin firebase_app_distribution + + - name: Distribute to Firebase - testharness.apk + if: ${{ env.DISTRIBUTE_TO_FIREBASE == 'true' }} + env: + APP_PLAY_FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/app_play_dev_firebase-creds.json + run: | + bundle exec fastlane distributeTestHarnessReleaseToFirebase \ + actionUrl:$GITHUB_ACTION_RUN_URL \ + service_credentials_file:$APP_PLAY_FIREBASE_CREDS_PATH diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 19d4d06e1f..0445aa8218 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -467,6 +467,22 @@ platform :android do ) end + desc "Publish release Test Harness APK to Firebase App Distribution" + lane :distributeTestHarnessReleaseToFirebase do |options| + releaseNotes = generateReleaseNotes( + repoName: "android", + actionUrl: "#{options[:actionUrl]}" + ) + firebase_app_distribution( + app: "1:1093287226212:android:12f84f87c883e8604b2871", + android_artifact_type: "APK", + android_artifact_path: "testharness/build/outputs/apk/release/com.bitwarden.testharness.apk", + service_credentials_file: options[:service_credentials_file], + groups: "internal-prod-group, livefront", + release_notes: "#{releaseNotes}", + ) + end + desc "Publish release AAB to Firebase" lane :distributeAuthenticatorReleaseBundleToFirebase do |options| release_notes = changelog_from_git_commits(