From 2057c0e1d226ef6bc1bafee4280aeae279154a88 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 15:46:51 +0200 Subject: [PATCH 1/5] Upgrade actions/upload-artifact to v4 The workflow do not upload multiple artifacts under the same 'name', so it can be easily upgraded to v4 without the need to handle breaking changes. --- workflow-templates/check-go-dependencies-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-templates/check-go-dependencies-task.yml b/workflow-templates/check-go-dependencies-task.yml index 375758ef..3daf9c42 100644 --- a/workflow-templates/check-go-dependencies-task.yml +++ b/workflow-templates/check-go-dependencies-task.yml @@ -111,7 +111,7 @@ jobs: # Some might find it convenient to have CI generate the cache rather than setting up for it locally - name: Upload cache to workflow artifact if: failure() && steps.diff.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: dep-licenses-cache From a77bc5681ad13ebeffabe058053b690eed08360e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 15:54:48 +0200 Subject: [PATCH 2/5] Upgrade actions/upload-artifact and actions/download-artifact to v4 The workflow previously uploaded multiple artifacts under the same 'name'. This is no more allowed on v4, so we have to upload each artifact under a unique name. When downloading we can merge multiple artifacts using the 'pattern' matching and the `merge-multiple: true` option. --- workflow-templates/publish-go-nightly-task.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/workflow-templates/publish-go-nightly-task.yml b/workflow-templates/publish-go-nightly-task.yml index d00defb3..8299fba1 100644 --- a/workflow-templates/publish-go-nightly-task.yml +++ b/workflow-templates/publish-go-nightly-task.yml @@ -54,10 +54,10 @@ jobs: run: task dist:${{ matrix.os }} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }} path: ${{ env.DIST_DIR }} notarize-macos: @@ -88,9 +88,10 @@ jobs: uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + pattern: ${{ env.ARTIFACT_NAME }}-* + merge-multiple: true path: ${{ env.DIST_DIR }} - name: Import Code-Signing Certificates @@ -165,10 +166,10 @@ jobs: echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }} path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} publish-nightly: @@ -180,9 +181,10 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + pattern: ${{ env.ARTIFACT_NAME }}-* + merge-multiple: true path: ${{ env.DIST_DIR }} - name: Create checksum file From b3be41687f65a56ba4db09829aab90bbd37e43c2 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 16:03:30 +0200 Subject: [PATCH 3/5] Upgrade actions/upload-artifact and actions/download-artifact to v4 The workflow do not upload multiple artifacts under the same 'name', so it can be easily upgraded to v4 without the need to handle breaking changes. --- workflow-templates/publish-go-tester-task.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow-templates/publish-go-tester-task.yml b/workflow-templates/publish-go-tester-task.yml index 74636423..142d2d39 100644 --- a/workflow-templates/publish-go-tester-task.yml +++ b/workflow-templates/publish-go-tester-task.yml @@ -131,7 +131,7 @@ jobs: # Transfer builds to artifacts job - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} name: ${{ matrix.os.name }} @@ -146,7 +146,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Create checksum file run: | @@ -161,7 +161,7 @@ jobs: done - name: Upload checksum artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./*checksums.txt name: checksums From 3b7926719f8e360a9649e3c5e0cd815bf800a93d Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 16:08:00 +0200 Subject: [PATCH 4/5] Upgrade actions/upload-artifact and actions/download-artifact to v4 The workflow previously uploaded multiple artifacts under the same 'name'. This is no more allowed on v4, so we have to upload each artifact under a unique name. When downloading we can merge multiple artifacts using the 'pattern' matching and the `merge-multiple: true` option. --- workflow-templates/release-go-task.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/workflow-templates/release-go-task.yml b/workflow-templates/release-go-task.yml index 94bac0fc..3624a226 100644 --- a/workflow-templates/release-go-task.yml +++ b/workflow-templates/release-go-task.yml @@ -61,10 +61,10 @@ jobs: run: task dist:${{ matrix.os }} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }} path: ${{ env.DIST_DIR }} notarize-macos: @@ -93,9 +93,10 @@ jobs: uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + pattern: ${{ env.ARTIFACT_NAME }}-* + merge-multiple: true path: ${{ env.DIST_DIR }} - name: Import Code-Signing Certificates @@ -170,10 +171,10 @@ jobs: echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }} path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} create-release: @@ -186,9 +187,10 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + pattern: ${{ env.ARTIFACT_NAME }}-* + merge-multiple: true path: ${{ env.DIST_DIR }} - name: Create checksum file From 0240e3b7061d920c7c03ba513daa1b3f9473fe2e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 16:20:06 +0200 Subject: [PATCH 5/5] Upgrade actions/upload-artifact@v4, actions/download-artifact@v4 and geekyeggo/delete-artifact@v5 The workflow previously uploaded multiple artifacts under the same 'name'. This is no more allowed on v4, so we have to upload each artifact under a unique name. When downloading we can merge multiple artifacts using the 'pattern' matching and the `merge-multiple: true` option. The geekyeggo/delete-artifact instead can use the pattern matching directly in the `name` field. --- workflow-templates/sync-labels.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/workflow-templates/sync-labels.yml b/workflow-templates/sync-labels.yml index 6efc3f42..6e969cff 100644 --- a/workflow-templates/sync-labels.yml +++ b/workflow-templates/sync-labels.yml @@ -73,13 +73,13 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }} sync: needs: download @@ -114,15 +114,16 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-* + merge-multiple: true path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT }}-* - name: Merge label configuration files run: |