Skip to content

Commit bebf92f

Browse files
cynthiajoanCynthia Jiang
andauthored
Make update version check latest cpp for next triggered workflow to use (#244)
Release workflow using cpp latest release tag Co-authored-by: Cynthia Jiang <[email protected]>
1 parent f002fa6 commit bebf92f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/sdk_build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ on:
1717
unity_branch:
1818
description: 'Unity branch to build against, empty means current branch'
1919
default: ''
20-
cpp_branch:
21-
description: 'CPP branch to build against, empty means current branch'
20+
firebase_cpp_sdk_version:
21+
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'
2222
default: ''
23+
required: false
2324

2425
jobs:
2526
build_desktop:
@@ -58,7 +59,7 @@ jobs:
5859
repository: firebase/firebase-cpp-sdk
5960
path: firebase-cpp-sdk
6061
submodules: true
61-
ref: ${{ github.event.inputs.cpp_branch }}
62+
ref: ${{ github.event.inputs.firebase_cpp_sdk_version }}
6263

6364
- name: Support longpaths
6465
if: startsWith(matrix.os, 'windows')

.github/workflows/update_versions.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ jobs:
161161
app_id: ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
162162
private_key: ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
163163

164+
- name: get latest cpp release with tag
165+
id: cpprelease
166+
run: |
167+
echo "::set-output name=release_tag::$(basename $(curl --silent "https://github.com/firebase/firebase-cpp-sdk/releases/latest" grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'))"
168+
- name: confirm release tag
169+
run: |
170+
echo latest cpp release version is: ${{ steps.cpprelease.outputs.release_tag }}
171+
164172
- name: Use GitHub API to start workflow
165173
shell: bash
166174
run: |
@@ -172,4 +180,8 @@ jobs:
172180
set -e
173181
compose_new_branch=firebase-unity-sdk/${{ needs.update_versions.outputs.new_branch }}
174182
echo "New branch is: ${compose_new_branch}"
175-
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-build-token.outputs.token }} -w ${{ matrix.trigger_file }} -p unity_branch ${{ needs.update_versions.outputs.new_branch }}
183+
python scripts/gha/trigger_workflow.py \
184+
-t ${{ steps.generate-build-token.outputs.token }} \
185+
-w ${{ matrix.trigger_file }} \
186+
-p unity_branch ${{ needs.update_versions.outputs.new_branch }} \
187+
-p firebase_cpp_sdk_version ${{ steps.cpprelease.outputs.release_tag }}

0 commit comments

Comments
 (0)