Skip to content

Commit f343cd9

Browse files
authored
dataconnect(ci): move firebase-tools version out of the yml workflow files (#8197)
1 parent 1ac16c8 commit f343cd9

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

.github/workflows/dataconnect.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ env:
3535
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
3636
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
3737
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
38-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '15.18.0' }}
38+
FDC_INPUT_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion }}
3939
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
4040
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
4141
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }}
@@ -54,6 +54,16 @@ jobs:
5454
with:
5555
show-progress: false
5656

57+
- name: Initialize FDC_FIREBASE_TOOLS_VERSION environment variable
58+
run: |
59+
set -euo pipefail
60+
if [[ -n "$FDC_INPUT_FIREBASE_TOOLS_VERSION" ]]; then
61+
version="$FDC_INPUT_FIREBASE_TOOLS_VERSION"
62+
else
63+
version="$(cat firebase-dataconnect/ci/firebase-tools-version.txt)"
64+
fi
65+
echo "FDC_FIREBASE_TOOLS_VERSION=${version}" >> "$GITHUB_ENV"
66+
5767
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
5868
with:
5969
java-version: ${{ env.FDC_JAVA_VERSION }}

.github/workflows/dataconnect_demo_app.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121

2222
env:
2323
FDC_NODE_VERSION: ${{ inputs.nodeVersion || '20' }}
24-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '15.18.0' }}
24+
FDC_INPUT_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion }}
2525
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
2626
FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools
2727
FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase
@@ -38,7 +38,19 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4040
with:
41-
sparse-checkout: firebase-dataconnect/demo
41+
sparse-checkout: |
42+
firebase-dataconnect/demo
43+
firebase-dataconnect/ci/
44+
45+
- name: Initialize FDC_FIREBASE_TOOLS_VERSION environment variable
46+
run: |
47+
set -euo pipefail
48+
if [[ -n "$FDC_INPUT_FIREBASE_TOOLS_VERSION" ]]; then
49+
version="$FDC_INPUT_FIREBASE_TOOLS_VERSION"
50+
else
51+
version="$(cat firebase-dataconnect/ci/firebase-tools-version.txt)"
52+
fi
53+
echo "FDC_FIREBASE_TOOLS_VERSION=${version}" >> "$GITHUB_ENV"
4254
4355
- name: Create Cache Key Files
4456
run: |

firebase-dataconnect/.agents/skills/dataconnect_emulator_upgrade/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Follow these steps sequentially:
4141
7. **Fetch Latest firebase-tools Version:**
4242
Determine the latest release version number of the `firebase-tools` repository using the GitHub CLI `gh` or by fetching the latest release for `Firebase/firebase-tools`. Do not include the 'v' prefix in the version number (e.g., use `15.8.0` instead of `v15.8.0`).
4343

44-
8. **Update GitHub Actions YAML Files:**
45-
Edit `../.github/workflows/dataconnect.yml` and `../.github/workflows/dataconnect_demo_app.yml`. Change the default `FDC_FIREBASE_TOOLS_VERSION` value to the latest release version number determined in the previous step. Note what the previous version was.
44+
8. **Update Central firebase-tools Version File:**
45+
Edit `ci/firebase-tools-version.txt`. Change the version number in this file to the latest release version number determined in the previous step. Note what the previous version was.
4646

4747
9. **Commit firebase-tools Update:**
48-
Add the YAML files and git commit the changes using a commit message that conforms exactly to this template:
49-
`dataconnect.yml/dataconnect_demo_app.yml: updated firebase-tools to <new_tools_version> (was <old_tools_version>)`
50-
*Example: `dataconnect.yml/dataconnect_demo_app.yml: updated firebase-tools to 15.8.0 (was 15.6.0)`*
48+
Add the version file and git commit the changes using a commit message that conforms exactly to this template:
49+
`firebase-tools-version.txt: updated firebase-tools to <new_tools_version> (was <old_tools_version>)`
50+
*Example: `firebase-tools-version.txt: updated firebase-tools to 15.8.0 (was 15.6.0)`*
5151

5252
10. **Push Changes to GitHub:**
5353
Push the changes up to the remote origin by running this exact command, substituting `Emulator_X_Y_Z` appropriately:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
15.18.0

0 commit comments

Comments
 (0)