From 38f2eb4cb2a8e400ce2ecb0b6f2854469c9626fc Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Wed, 26 Oct 2022 10:51:05 -0500 Subject: [PATCH] fix(firebase): inject service file for older OS versions --- .github/actions/prepare_for_build/action.yml | 21 ++++++++++++++++---- .github/workflows/build.yml | 10 +++++----- .github/workflows/build_android.yml | 6 +++--- .github/workflows/build_ios.yml | 4 ++-- .github/workflows/build_macos.yml | 8 ++++---- .github/workflows/build_web.yml | 4 ++-- .github/workflows/prepare.yml | 4 ++-- .github/workflows/validate.yml | 4 ++-- 8 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.github/actions/prepare_for_build/action.yml b/.github/actions/prepare_for_build/action.yml index 8703fc26..d188abfb 100644 --- a/.github/actions/prepare_for_build/action.yml +++ b/.github/actions/prepare_for_build/action.yml @@ -7,8 +7,8 @@ inputs: required: true # Config - firebase-options: - description: 'Firebase Options' + firebase-token: + description: 'Firebase Token' required: false default: '' skip-core: @@ -118,9 +118,22 @@ runs: echo ${{ inputs.android-key-properties }} | base64 --decode > android/key.properties - name: Setup Firebase Configuration - if: ${{ inputs.firebase-options != '' }} + if: ${{ inputs.firebase-token != '' }} shell: bash - run: echo ${{ inputs.firebase-options }} | base64 --decode > lib/firebase/options.dart + run: | + npm install -g firebase-tools + gem install --user-install xcodeproj + dart pub global activate flutterfire_cli + + flutterfire configure \ + --project=comettools-lunasea \ + --token=${{ inputs.firebase-token }} \ + --platforms=android,ios,macos,web \ + --android-package-name=app.lunasea.lunasea \ + --ios-bundle-id=app.lunasea.lunasea \ + --macos-bundle-id=app.lunasea.lunasea \ + --out=lib/firebase/options.dart \ + --yes - name: Setup Firebase Service Worker if: ${{ inputs.firebase-service-worker != '' }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c27ed56b..e0d1fe1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: with: flavor: ${{ inputs.flavor }} secrets: - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} build-android: @@ -34,7 +34,7 @@ jobs: with: build-number: ${{ needs.prepare.outputs.build-number }} secrets: - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} KEY_JKS: ${{ secrets.KEY_JKS }} KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} @@ -48,7 +48,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} IOS_CODESIGNING_IDENTITY: ${{ secrets.IOS_CODESIGNING_IDENTITY }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} @@ -74,7 +74,7 @@ jobs: APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} MACOS_INSTALLER_CERT_APP_STORE: ${{ secrets.MACOS_INSTALLER_CERT_APP_STORE }} MACOS_INSTALLER_CERT_DIRECT: ${{ secrets.MACOS_INSTALLER_CERT_DIRECT }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} @@ -90,8 +90,8 @@ jobs: build-flavor: ${{ needs.prepare.outputs.build-flavor }} build-title: ${{ needs.prepare.outputs.build-title }} secrets: - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} FIREBASE_SERVICE_WORKER: ${{ secrets.FIREBASE_SERVICE_WORKER }} + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} build-windows: name: Build Windows diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index 1847c478..1823b906 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -8,7 +8,7 @@ on: type: string secrets: - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true KEY_JKS: required: true @@ -23,7 +23,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: android android-key-jks: ${{ secrets.KEY_JKS }} android-key-properties: ${{ secrets.KEY_PROPERTIES }} @@ -45,7 +45,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: android android-key-jks: ${{ secrets.KEY_JKS }} android-key-properties: ${{ secrets.KEY_PROPERTIES }} diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index a5e12c2a..b447f061 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -14,7 +14,7 @@ on: required: true APPLE_TEAM_ID: required: true - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true IOS_CODESIGNING_IDENTITY: required: true @@ -35,7 +35,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: ios match-ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 19fc3abc..491dcbe4 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -23,7 +23,7 @@ on: required: true APPLE_TEAM_ID: required: true - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true MACOS_INSTALLER_CERT_APP_STORE: required: true @@ -46,7 +46,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: macos appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }} match-ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} @@ -79,7 +79,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: macos appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }} match-ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} @@ -112,7 +112,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: macos appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }} match-ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/build_web.yml b/.github/workflows/build_web.yml index 1dda9f6d..e085b82b 100644 --- a/.github/workflows/build_web.yml +++ b/.github/workflows/build_web.yml @@ -11,7 +11,7 @@ on: type: string secrets: - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true FIREBASE_SERVICE_WORKER: required: true @@ -24,7 +24,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} firebase-service-worker: ${{ secrets.FIREBASE_SERVICE_WORKER }} platform: web diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 2a9b67e8..49f9cb26 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -25,7 +25,7 @@ on: value: ${{ jobs.build-details.outputs.build-version }} secrets: - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true SENTRY_DSN: required: true @@ -124,7 +124,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: test skip-core: true diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fc85f9aa..20a2ad79 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -3,7 +3,7 @@ name: Validate on: workflow_call: secrets: - FIREBASE_OPTIONS: + FIREBASE_TOKEN: required: true jobs: @@ -14,7 +14,7 @@ jobs: - name: Setup Environment uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master with: - firebase-options: ${{ secrets.FIREBASE_OPTIONS }} + firebase-token: ${{ secrets.FIREBASE_TOKEN }} platform: test - name: Analyze Release