Skip to content

Commit 1580495

Browse files
committed
Switch to github env, add latest any artifact
1 parent feb8c86 commit 1580495

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/cd.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -407,40 +407,51 @@ jobs:
407407
service_account: github-plugin-ci-workflows@grafanalabs-workload-identity.iam.gserviceaccount.com
408408

409409
- name: Determine GCS artifacts paths
410+
id: paths
410411
run: |
411412
plugin_version='${{ fromJSON(needs.ci.outputs.plugin).version }}'
412413
gcs_artifacts_release_base="${{ env.GCS_ARTIFACTS_BUCKET }}/${{ fromJSON(needs.ci.outputs.plugin).id }}/release"
413414
{
415+
echo "gcs_artifacts_release_base=$gcs_artifacts_release_base"
414416
echo "gcs_artifacts_release_path_latest=$gcs_artifacts_release_base/latest"
415417
echo "gcs_artifacts_release_path_tag=$gcs_artifacts_release_base/$plugin_version"
416418
fn=$(basename ${{ needs.ci.outputs.gcs-universal-zip-url-commit }})
417419
latest_fn=${fn//${{ fromJSON(needs.ci.outputs.plugin).version }}/latest}
418420
if [ "${{ matrix.platform }}" == 'any' ]; then
419421
echo "gcs_upload_glob=$fn*"
420-
echo "gcs_upload_glob_latest=$latest_fn*"
422+
echo "gcs_upload_glob_latest=$latest_fn"
421423
else
422424
# strip the extension (.zip) and append the platform instead
423425
echo "gcs_upload_glob=${fn%.*}.${{ matrix.platform }}*"
424426
echo "gcs_upload_glob_latest=${latest_fn%.*}.${{ matrix.platform }}*"
425427
fi
426-
} >> "$GITHUB_ENV"
428+
} >> "$GITHUB_OUTPUT"
427429
shell: bash
428430

429431
- name: Upload GCS release artifact (tag)
430432
uses: google-github-actions/[email protected]
431433
with:
432434
path: /tmp/dist-artifacts
433-
glob: ${{ env.gcs_upload_glob }}
434-
destination: "${{ env.gcs_artifacts_release_path_tag }}/${{ matrix.platform }}"
435+
glob: ${{ steps.paths.outputs.gcs_upload_glob }}
436+
destination: "${{ steps.paths.outputs.gcs_artifacts_release_path_tag }}/${{ matrix.platform }}"
435437
parent: false
436438
process_gcloudignore: false
437439

438440
- name: Upload GCS release artifact (latest)
439441
uses: google-github-actions/[email protected]
440442
with:
441443
path: /tmp/dist-artifacts-latest
442-
glob: ${{ env.gcs_upload_glob_latest }}
443-
destination: "${{ env.gcs_artifacts_release_path_latest }}/${{ matrix.platform }}"
444+
glob: ${{ steps.paths.outputs.gcs_upload_glob_latest }}
445+
destination: "${{ steps.paths.outputs.gcs_artifacts_release_path_latest }}/${{ matrix.platform }}"
446+
parent: false
447+
process_gcloudignore: false
448+
449+
- name: Upload GCS release artifacst (latest, any)
450+
if: ${{ matrix.platform == 'any' }}
451+
uses: google-github-actions/[email protected]
452+
with:
453+
path: /tmp/dist-artifacts-latest/${{ steps.paths.outputs.gcs_upload_glob_latest }}
454+
destination: "${{ steps.paths.outputs.gcs_artifacts_release_base }}/${{ fromJSON(needs.ci.outputs.plugin).id }}-latest.zip"
444455
parent: false
445456
process_gcloudignore: false
446457

0 commit comments

Comments
 (0)