Skip to content

Commit 5eaaca6

Browse files
authored
Merge pull request #1292 from google/lsc-1771417813.9192708
Refactor Github Action per b/485167538
2 parents b985c9b + 88249de commit 5eaaca6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/cli-release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
- id: cargo-dist
203203
shell: bash
204204
run: |
205-
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
205+
dist build ${NEEDS_PLAN_OUTPUTS_TAG_FLAG} --output-format=json "--artifacts=global" > dist-manifest.json
206206
echo "dist ran successfully"
207207
208208
# Parse out what we just built and upload it to scratch storage
@@ -211,6 +211,8 @@ jobs:
211211
echo "EOF" >> "$GITHUB_OUTPUT"
212212
213213
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
214+
env:
215+
NEEDS_PLAN_OUTPUTS_TAG_FLAG: ${{ needs.plan.outputs.tag-flag }}
214216
- name: "Upload artifacts"
215217
uses: actions/upload-artifact@v4
216218
with:
@@ -252,10 +254,12 @@ jobs:
252254
- id: host
253255
shell: bash
254256
run: |
255-
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
257+
dist host ${NEEDS_PLAN_OUTPUTS_TAG_FLAG} --steps=upload --steps=release --output-format=json > dist-manifest.json
256258
echo "artifacts uploaded and released successfully"
257259
cat dist-manifest.json
258260
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
261+
env:
262+
NEEDS_PLAN_OUTPUTS_TAG_FLAG: ${{ needs.plan.outputs.tag-flag }}
259263
- name: "Upload dist-manifest.json"
260264
uses: actions/upload-artifact@v4
261265
with:
@@ -279,11 +283,12 @@ jobs:
279283
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
280284
ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
281285
RELEASE_COMMIT: "${{ github.sha }}"
286+
NEEDS_PLAN_OUTPUTS_TAG: ${{ needs.plan.outputs.tag }}
282287
run: |
283288
# Write and read notes from a file to avoid quoting breaking things
284289
echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
285290
286-
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
291+
gh release create "${NEEDS_PLAN_OUTPUTS_TAG}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
287292
288293
announce:
289294
needs:

0 commit comments

Comments
 (0)