Skip to content

Commit 23b6ace

Browse files
authored
Add workflow to update Firebase C++ SDK deps when iOS SDK release is published (#8654)
Whenever a release is published (except for CocoaPods-* releases), trigger the C++ SDK to do an iOS dependency update, pulling latest deps from public Cocoapods HEAD. It requests a token that has access to firebase-cpp-sdk and uses that token to trigger the C++ update-dependencies workflow. (Android equivalent is here: firebase/firebase-android-sdk#2977)
1 parent 49a7259 commit 23b6ace

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Whenever a new Firebase iOS SDK is released, this workflow triggers *another*
2+
# workflow on the Firebase C++ SDK, which will check for the iOS version update
3+
# and create a PR updating its iOS dependencies if the version number has
4+
# changed.
5+
name: update-cpp-sdk-on-release
6+
on:
7+
release:
8+
types: [ published ]
9+
10+
jobs:
11+
trigger_cpp_sdk_update:
12+
# Only when a new release (not just the CocoaPods-* tag) is published.
13+
if: ${{ (github.event_name == 'release' && !contains(github.ref, 'CocoaPods')) }}
14+
# Fetch an authentication token for firebase-workflow-trigger, then use that
15+
# token to trigger the update-dependencies workflow in firebase-cpp-sdk.
16+
name: Trigger C++ SDK update
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Setup python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.7
23+
24+
- name: Check out firebase-cpp-sdk
25+
uses: actions/[email protected]
26+
with:
27+
repository: firebase/firebase-cpp-sdk
28+
ref: main
29+
30+
- name: Get firebase-workflow-trigger token
31+
uses: tibdex/github-app-token@v1
32+
id: generate-token
33+
with:
34+
app_id: ${{ secrets.CPP_WORKFLOW_TRIGGER_APP_ID }}
35+
private_key: ${{ secrets.CPP_WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
36+
repository: firebase/firebase-cpp-sdk
37+
38+
- name: Trigger firebase-cpp-sdk update
39+
run: |
40+
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} -w update-dependencies.yml -p updateAndroid 0 -p updateiOS 1 -p comment "[Triggered]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) by [firebase-ios-sdk $GITHUB_REF release]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$GITHUB_REF)." -s 10 -A

0 commit comments

Comments
 (0)