ios-templates icon indicating copy to clipboard operation
ios-templates copied to clipboard

Replace Firebase Token with Google Service Account

Open blyscuit opened this issue 1 year ago • 0 comments

Why

Currently we are using firebase_token to upload a new build to Firebase Distribution, but this approach requires the token be generated from an account, ideally a shared account.

Using Google Service Account does not require a shared account and the key can be shared with Android project.

More info on Service Account: https://firebase.google.com/docs/app-distribution/ios/distribute-fastlane#service-acc-fastlane

Acceptance Criteria

  • Replace FIREBASE_TOKEN from all workflows Secrets and use FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 instead.
  • GH
  • Bitrise
  • CodeMagic
  • Set ENV GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.firebase_service_account.outputs.filePath }} to allow Fastlane to automatically use Service Account to upload.

example:

    - name: Read Google Service Account
      id: firebase_service_account
      uses: timheuer/[email protected]
      with:
        fileName: 'firebase_service_account.json'
        encodedString: ${{ secrets.FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
    - name: Build Production App and Distribute to Firebase
      run: bundle exec fastlane buildProductionAndUploadToFirebase
      env:
        GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.firebase_service_account.outputs.filePath }}

Who Benefits?

Users.

blyscuit avatar Sep 07 '23 05:09 blyscuit