-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Generate Firebase Options" | ||
description: "Generate Firebase Options" | ||
inputs: | ||
firebase_service_account_json: | ||
description: 'Firebase service account JSON' | ||
required: true | ||
firebase_project_id: | ||
description: 'Firebase project ID' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Firebase CLI | ||
shell: bash | ||
run: | | ||
npm install -g firebase-tools | ||
- name: Configure Firebase Credentials | ||
shell: bash | ||
run: | | ||
echo "${{ inputs.firebase_service_account_json }}" > service_account.json | ||
[[ -f "service_account.json" ]] && echo "service_account.json exists!" || (echo "ERROR: service_account.json does NOT exist!"; exit 1) | ||
export GOOGLE_APPLICATION_CREDENTIALS=service_account.json | ||
- name: Generate Options File | ||
shell: bash | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: service_account.json | ||
run: | | ||
[[ -f "service_account.json" ]] && echo "service_account.json exists!" || (echo "ERROR: service_account.json does NOT exist!"; exit 1) | ||
[[ -z "$GOOGLE_APPLICATION_CREDENTIALS" ]] && (echo "ERROR: GOOGLE_APPLICATION_CREDENTIALS is NOT set!" && exit 1) || echo "GOOGLE_APPLICATION_CREDENTIALS is set: $GOOGLE_APPLICATION_CREDENTIALS" | ||
firebase use ${{ inputs.firebase_project_id }} --non-interactive | ||
firebase apps:sdks --platform=android,ios,web > lib/firebase_options.dart | ||
- name: Clean up | ||
shell: bash | ||
if: always() | ||
run: rm service_account.json |
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
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