Skip to content

Commit

Permalink
[skip-changelog] Update artifact-related actions (#2679)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cmaglie authored Jul 31, 2024
1 parent c86ca30 commit cbec871
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/publish-go-nightly-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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"
Expand All @@ -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
29 changes: 16 additions & 13 deletions .github/workflows/release-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit cbec871

Please sign in to comment.