From 0f68d327ab63b0ac18c94cf7cec357909ddc92c1 Mon Sep 17 00:00:00 2001 From: Cyclinder Kuo Date: Thu, 26 Dec 2024 10:33:53 +0800 Subject: [PATCH] CI: use merge-multiple for download-artifact Signed-off-by: Cyclinder Kuo --- .github/workflows/auto-upgrade-ci.yaml | 25 ++++++------------- .github/workflows/build-image-ci.yaml | 9 ++----- .github/workflows/build-image-plugins.yaml | 2 +- .github/workflows/call-release-changelog.yaml | 2 +- .github/workflows/call-release-doc.yaml | 2 +- .github/workflows/trivy-scan-image.yaml | 10 ++------ 6 files changed, 14 insertions(+), 36 deletions(-) diff --git a/.github/workflows/auto-upgrade-ci.yaml b/.github/workflows/auto-upgrade-ci.yaml index c8600f19fc..28ac370da8 100644 --- a/.github/workflows/auto-upgrade-ci.yaml +++ b/.github/workflows/auto-upgrade-ci.yaml @@ -79,7 +79,7 @@ jobs: echo "NEW_VERSION=${{ github.event.inputs.ref }}" >> $GITHUB_ENV echo "SKIP_CREATE_PR=true" >> $GITHUB_ENV echo "RUN_UPGRADE_ENABLED=true" >> $GITHUB_ENV - echo "BUILD_OLD_IMAGE_TAG=false" >> $GITHUB_ENV + echo "BUILD_OLD_IMAGE_TAG=true" >> $GITHUB_ENV if ${{ github.event.inputs.e2e_enabled == 'true' }}; then echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV else @@ -208,19 +208,13 @@ jobs: run: | bash ./test/scripts/install-tools.sh - - name: Download old spiderpool-agent image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }} + - name: Download old spiderpool-agent and spiderpool-controller image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }} if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }} uses: actions/download-artifact@v4.1.8 with: path: test/.download - pattern: old-image-tar-spiderpool-agent-${{ needs.call_build_old_ci_image.outputs.imageTag }} - - - name: Download old spiderpool-controller image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }} - if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }} - uses: actions/download-artifact@v4.1.8 - with: - path: test/.download - pattern: old-image-tar-spiderpool-controller-${{ needs.call_build_old_ci_image.outputs.imageTag }} + merge-multiple: true + pattern: old-image-tar-spiderpool-*-${{ needs.call_build_old_ci_image.outputs.imageTag }} - name: Load Images if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }} @@ -303,17 +297,12 @@ jobs: mkdir -p ${{ env.KUBECONFIG_PATH }}/${{ env.E2E_CLUSTER_NAME }}/.kube/ cp -r /tmp/config ${{ env.KUBECONFIG_PATH }}/${{ env.E2E_CLUSTER_NAME }}/.kube/config - - name: Download new spiderpool-agent image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }} - uses: actions/download-artifact@v4.1.8 - with: - path: test/.download - pattern: new-image-tar-spiderpool-agent-${{ needs.call_build_old_ci_image.outputs.imageTag }} - - - name: Download new spiderpool-controller image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }} + - name: Download new spiderpool-agent and spiderpool-controller image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }} uses: actions/download-artifact@v4.1.8 with: path: test/.download - pattern: new-image-tar-spiderpool-controller-${{ needs.call_build_old_ci_image.outputs.imageTag }} + pattern: new-image-tar-spiderpool-*-${{ needs.call_build_new_ci_image.outputs.imageTag }} + merge-multiple: true - name: Load Images with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }} run: | diff --git a/.github/workflows/build-image-ci.yaml b/.github/workflows/build-image-ci.yaml index 6039080510..6f6c019ef2 100644 --- a/.github/workflows/build-image-ci.yaml +++ b/.github/workflows/build-image-ci.yaml @@ -303,14 +303,9 @@ jobs: - name: Download digests of all images built uses: actions/download-artifact@v4.1.8 with: - pattern: image-digest-spiderpool-agent-* - path: image-digest/ - - - name: Download digests of all images built - uses: actions/download-artifact@v4.1.8 - with: - pattern: image-digest-spiderpool-controller-* + pattern: image-digest-spiderpool-*-${{ needs.build_and_push_prs.outputs.imageTag }} path: image-digest/ + merge-multiple: true - name: Image Digests Output shell: bash diff --git a/.github/workflows/build-image-plugins.yaml b/.github/workflows/build-image-plugins.yaml index c737ddf0be..f0e81f7d4e 100644 --- a/.github/workflows/build-image-plugins.yaml +++ b/.github/workflows/build-image-plugins.yaml @@ -151,7 +151,7 @@ jobs: uses: actions/download-artifact@v4.1.8 with: path: image-digest/ - pattern: image-digest-* + pattern: image-digest-${{ env.IMAGE_NAME }}-* merge-multiple: true - name: Image Digests Output diff --git a/.github/workflows/call-release-changelog.yaml b/.github/workflows/call-release-changelog.yaml index 4e6f66c47d..5a0bce1707 100644 --- a/.github/workflows/call-release-changelog.yaml +++ b/.github/workflows/call-release-changelog.yaml @@ -128,7 +128,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4.1.8 with: - pattern: changelog_artifact_${{ env.RUN_dest_tag }} + pattern: changelog_artifact_${{ needs.generate_changelog.outputs.dest_tag }} path: ${{ env.DEST_DIRECTORY }} - uses: crazy-max/ghaction-import-gpg@v6 diff --git a/.github/workflows/call-release-doc.yaml b/.github/workflows/call-release-doc.yaml index 956bf3af66..48a1b27cff 100644 --- a/.github/workflows/call-release-doc.yaml +++ b/.github/workflows/call-release-doc.yaml @@ -154,7 +154,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4.1.8 with: - pattern: website_package_artifact_${{ env.REF }} + pattern: website_package_artifact_${{ needs.release_doc.outputs.ref }} path: ./ merge-multiple: true diff --git a/.github/workflows/trivy-scan-image.yaml b/.github/workflows/trivy-scan-image.yaml index 3a8ae50fe7..b86df21ce3 100644 --- a/.github/workflows/trivy-scan-image.yaml +++ b/.github/workflows/trivy-scan-image.yaml @@ -23,16 +23,10 @@ jobs: persist-credentials: false ref: ${{ inputs.ref }} - - name: Download spiderpool-agent image + - name: Download spiderpool-agent and spiderpool-controller image uses: actions/download-artifact@v4.1.8 with: - name: image-tar-spiderpool-agent-${{ inputs.ref }} - path: test/.download - - - name: Download spiderpool-controller image - uses: actions/download-artifact@v4.1.8 - with: - name: image-tar-spiderpool-controller-${{ inputs.ref }} + name: image-tar-spiderpool-*-${{ inputs.ref }} path: test/.download - name: List downloaded files