From cbec871185a71496f23b67f275c5bc0cf4804804 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Jul 2024 15:19:34 +0200 Subject: [PATCH] [skip-changelog] Update artifact-related actions (#2679) * Updated check-go-dependency workflow In this case we should be fine since there is just one job that uploads the artifacts. * Updated publish-go-tester workflow In this case the uploaded artifacts uses different paths and names, there should be no breaking changes. * Updated publish-go-nightly job In this case the jobs exploited the previous action behaviour when uploading multiple artifacts under the same "name". To upgrade to v4 we need to upload artifacts with unique "name" and merge them when downloading using the "pattern" property. * Updated release-go job This job got the same changes made in the publish-go-nightly job. * Updated sync-label job * Updated test-go job * Updated comments * Missed matrix run in sync-labels workflows. * Missed double-matrix run in test-go workflow --- .../workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/publish-go-nightly-task.yml | 29 ++++++++++--------- .github/workflows/publish-go-tester-task.yml | 6 ++-- .github/workflows/release-go-task.yml | 29 ++++++++++--------- .github/workflows/sync-labels.yml | 11 +++---- .github/workflows/test-go-task.yml | 13 +++++---- 6 files changed, 49 insertions(+), 41 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index eab16eb6172..ad4d5b3ab88 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -102,7 +102,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 diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index d42fac2d954..ff45fd27fcf 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -65,10 +65,10 @@ jobs: run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT - 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: @@ -92,9 +92,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 @@ -156,7 +157,7 @@ jobs: working-directory: ${{ env.DIST_DIR }} # Repackage the signed binary replaced in place by Gon (ignoring the output zip file) run: | - # GitHub's upload/download-artifact@v2 actions don't preserve file permissions, + # GitHub's upload/download-artifact actions don't preserve file permissions, # so we need to add execution permission back until the action is made to do this. chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}" VERSION=${{ needs.create-nightly-artifacts.outputs.version }} @@ -167,10 +168,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-windows-installer: @@ -192,9 +193,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: Prepare PATH @@ -222,12 +224,12 @@ jobs: "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino CLI" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${{ env.MSI_FILE }}" - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: MSI_FILE: ${{ steps.buildmsi.outputs.msi }} with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-windows-installer path: ${{ env.MSI_FILE }} publish-nightly: @@ -246,9 +248,10 @@ jobs: uses: actions/checkout@v4 - 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: Install Task diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index c83f00957d8..6f26162096c 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -135,7 +135,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.artifact.path }} name: ${{ matrix.artifact.name }} @@ -148,7 +148,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Output checksum run: | TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot" @@ -162,7 +162,7 @@ jobs: done - name: Upload checksum artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./*checksums.txt name: checksums diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index b6289912b14..d536c21cbc2 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -65,10 +65,10 @@ jobs: run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT - 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: @@ -92,9 +92,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 @@ -156,7 +157,7 @@ jobs: working-directory: ${{ env.DIST_DIR }} # Repackage the signed binary replaced in place by Gon (ignoring the output zip file) run: | - # GitHub's upload/download-artifact@v2 actions don't preserve file permissions, + # GitHub's upload/download-artifact actions don't preserve file permissions, # so we need to add execution permission back until the action is made to do this. chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}" TAG=${{ needs.create-release-artifacts.outputs.version }} @@ -167,10 +168,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-windows-installer: @@ -192,9 +193,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: Prepare PATH @@ -222,12 +224,12 @@ jobs: "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino CLI" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${{ env.MSI_FILE }}" - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: MSI_FILE: ${{ steps.buildmsi.outputs.msi }} with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }}-windows-installer path: ${{ env.MSI_FILE }} create-release: @@ -246,9 +248,10 @@ jobs: uses: actions/checkout@v4 - 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: Install Task diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9ecf638e861..4af604b92a2 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -71,13 +71,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 @@ -109,13 +109,14 @@ 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 }} diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 17ce103a06d..8f808744e3a 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -114,10 +114,10 @@ jobs: mv coverage_integration.txt coverage_integration_${{ matrix.operating-system }}_${{ matrix.tests }}.txt - name: Upload coverage data to workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.COVERAGE_ARTIFACT }} + name: ${{ env.COVERAGE_ARTIFACT }}-test-integration-${{ matrix.operating-system }}-${{ matrix.tests }} path: | ./coverage_integration_*.txt @@ -157,10 +157,10 @@ jobs: - name: Upload coverage data to workflow artifact if: runner.os == 'Linux' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.COVERAGE_ARTIFACT }} + name: ${{ env.COVERAGE_ARTIFACT }}-test-${{ matrix.operating-system }} path: | ./coverage_unit.txt @@ -182,9 +182,10 @@ jobs: run: go install github.com/wadey/gocovmerge@b5bfa59 - name: Download coverage data artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.COVERAGE_ARTIFACT }} + pattern: ${{ env.COVERAGE_ARTIFACT }}-* + merge-multiple: true - name: Merge all code coverage artifacts run: gocovmerge coverage*.txt > coverage.txt