Skip to content

Commit feb8c86

Browse files
committed
CD: Fix path for 'latest' artifacts
1 parent ae1a278 commit feb8c86

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/cd.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,15 @@ jobs:
391391
name: dist-artifacts
392392
path: /tmp/dist-artifacts
393393

394+
- name: Prepare "latest" artifacts
395+
run: |
396+
cp -r /tmp/dist-artifacts /tmp/dist-artifacts-latest
397+
# Replace the version with "latest" in the zip file name
398+
find /tmp/dist-artifacts-latest -type f -name "*.zip" -exec bash -c 'mv "$1" "${1//${{ fromJSON(needs.ci.outputs.plugin).version }}/latest}"' _ {} \;
399+
# TODO: remove, debug
400+
ls -1 /tmp/dist-artifacts-latest
401+
shell: bash
402+
394403
- name: Login to Google Cloud
395404
uses: google-github-actions/[email protected]
396405
with:
@@ -405,11 +414,14 @@ jobs:
405414
echo "gcs_artifacts_release_path_latest=$gcs_artifacts_release_base/latest"
406415
echo "gcs_artifacts_release_path_tag=$gcs_artifacts_release_base/$plugin_version"
407416
fn=$(basename ${{ needs.ci.outputs.gcs-universal-zip-url-commit }})
417+
latest_fn=${fn//${{ fromJSON(needs.ci.outputs.plugin).version }}/latest}
408418
if [ "${{ matrix.platform }}" == 'any' ]; then
409419
echo "gcs_upload_glob=$fn*"
420+
echo "gcs_upload_glob_latest=$latest_fn*"
410421
else
411422
# strip the extension (.zip) and append the platform instead
412423
echo "gcs_upload_glob=${fn%.*}.${{ matrix.platform }}*"
424+
echo "gcs_upload_glob_latest=${latest_fn%.*}.${{ matrix.platform }}*"
413425
fi
414426
} >> "$GITHUB_ENV"
415427
shell: bash
@@ -426,8 +438,8 @@ jobs:
426438
- name: Upload GCS release artifact (latest)
427439
uses: google-github-actions/[email protected]
428440
with:
429-
path: /tmp/dist-artifacts
430-
glob: ${{ env.gcs_upload_glob }}
441+
path: /tmp/dist-artifacts-latest
442+
glob: ${{ env.gcs_upload_glob_latest }}
431443
destination: "${{ env.gcs_artifacts_release_path_latest }}/${{ matrix.platform }}"
432444
parent: false
433445
process_gcloudignore: false

0 commit comments

Comments
 (0)