Skip to content

Commit cbec871

Browse files
authored
[skip-changelog] Update artifact-related actions (arduino#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
1 parent c86ca30 commit cbec871

6 files changed

+49
-41
lines changed

.github/workflows/check-go-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
103103
- name: Upload cache to workflow artifact
104104
if: failure() && steps.diff.outcome == 'failure'
105-
uses: actions/upload-artifact@v3
105+
uses: actions/upload-artifact@v4
106106
with:
107107
if-no-files-found: error
108108
name: dep-licenses-cache

.github/workflows/publish-go-nightly-task.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT
6666

6767
- name: Upload artifacts
68-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@v4
6969
with:
7070
if-no-files-found: error
71-
name: ${{ env.ARTIFACT_NAME }}
71+
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }}
7272
path: ${{ env.DIST_DIR }}
7373

7474
notarize-macos:
@@ -92,9 +92,10 @@ jobs:
9292
uses: actions/checkout@v4
9393

9494
- name: Download artifacts
95-
uses: actions/download-artifact@v3
95+
uses: actions/download-artifact@v4
9696
with:
97-
name: ${{ env.ARTIFACT_NAME }}
97+
pattern: ${{ env.ARTIFACT_NAME }}-*
98+
merge-multiple: true
9899
path: ${{ env.DIST_DIR }}
99100

100101
- name: Import Code-Signing Certificates
@@ -156,7 +157,7 @@ jobs:
156157
working-directory: ${{ env.DIST_DIR }}
157158
# Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
158159
run: |
159-
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
160+
# GitHub's upload/download-artifact actions don't preserve file permissions,
160161
# so we need to add execution permission back until the action is made to do this.
161162
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
162163
VERSION=${{ needs.create-nightly-artifacts.outputs.version }}
@@ -167,10 +168,10 @@ jobs:
167168
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
168169
169170
- name: Upload artifact
170-
uses: actions/upload-artifact@v3
171+
uses: actions/upload-artifact@v4
171172
with:
172173
if-no-files-found: error
173-
name: ${{ env.ARTIFACT_NAME }}
174+
name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }}
174175
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
175176

176177
create-windows-installer:
@@ -192,9 +193,10 @@ jobs:
192193
uses: actions/checkout@v4
193194

194195
- name: Download artifacts
195-
uses: actions/download-artifact@v3
196+
uses: actions/download-artifact@v4
196197
with:
197-
name: ${{ env.ARTIFACT_NAME }}
198+
pattern: ${{ env.ARTIFACT_NAME }}-*
199+
merge-multiple: true
198200
path: ${{ env.DIST_DIR }}
199201

200202
- name: Prepare PATH
@@ -222,12 +224,12 @@ jobs:
222224
"${{ 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 }}"
223225
224226
- name: Upload artifacts
225-
uses: actions/upload-artifact@v3
227+
uses: actions/upload-artifact@v4
226228
env:
227229
MSI_FILE: ${{ steps.buildmsi.outputs.msi }}
228230
with:
229231
if-no-files-found: error
230-
name: ${{ env.ARTIFACT_NAME }}
232+
name: ${{ env.ARTIFACT_NAME }}-windows-installer
231233
path: ${{ env.MSI_FILE }}
232234

233235
publish-nightly:
@@ -246,9 +248,10 @@ jobs:
246248
uses: actions/checkout@v4
247249

248250
- name: Download artifact
249-
uses: actions/download-artifact@v3
251+
uses: actions/download-artifact@v4
250252
with:
251-
name: ${{ env.ARTIFACT_NAME }}
253+
pattern: ${{ env.ARTIFACT_NAME }}-*
254+
merge-multiple: true
252255
path: ${{ env.DIST_DIR }}
253256

254257
- name: Install Task

.github/workflows/publish-go-tester-task.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
136136
# Transfer builds to artifacts job
137137
- name: Upload build artifact
138-
uses: actions/upload-artifact@v3
138+
uses: actions/upload-artifact@v4
139139
with:
140140
path: ${{ env.DIST_DIR }}/${{ matrix.artifact.path }}
141141
name: ${{ matrix.artifact.name }}
@@ -148,7 +148,7 @@ jobs:
148148

149149
steps:
150150
- name: Download build artifacts
151-
uses: actions/download-artifact@v3
151+
uses: actions/download-artifact@v4
152152
- name: Output checksum
153153
run: |
154154
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
@@ -162,7 +162,7 @@ jobs:
162162
done
163163
164164
- name: Upload checksum artifact
165-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@v4
166166
with:
167167
path: ./*checksums.txt
168168
name: checksums

.github/workflows/release-go-task.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT
6666

6767
- name: Upload artifacts
68-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@v4
6969
with:
7070
if-no-files-found: error
71-
name: ${{ env.ARTIFACT_NAME }}
71+
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }}
7272
path: ${{ env.DIST_DIR }}
7373

7474
notarize-macos:
@@ -92,9 +92,10 @@ jobs:
9292
uses: actions/checkout@v4
9393

9494
- name: Download artifacts
95-
uses: actions/download-artifact@v3
95+
uses: actions/download-artifact@v4
9696
with:
97-
name: ${{ env.ARTIFACT_NAME }}
97+
pattern: ${{ env.ARTIFACT_NAME }}-*
98+
merge-multiple: true
9899
path: ${{ env.DIST_DIR }}
99100

100101
- name: Import Code-Signing Certificates
@@ -156,7 +157,7 @@ jobs:
156157
working-directory: ${{ env.DIST_DIR }}
157158
# Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
158159
run: |
159-
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
160+
# GitHub's upload/download-artifact actions don't preserve file permissions,
160161
# so we need to add execution permission back until the action is made to do this.
161162
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
162163
TAG=${{ needs.create-release-artifacts.outputs.version }}
@@ -167,10 +168,10 @@ jobs:
167168
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
168169
169170
- name: Upload artifact
170-
uses: actions/upload-artifact@v3
171+
uses: actions/upload-artifact@v4
171172
with:
172173
if-no-files-found: error
173-
name: ${{ env.ARTIFACT_NAME }}
174+
name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }}
174175
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
175176

176177
create-windows-installer:
@@ -192,9 +193,10 @@ jobs:
192193
uses: actions/checkout@v4
193194

194195
- name: Download artifacts
195-
uses: actions/download-artifact@v3
196+
uses: actions/download-artifact@v4
196197
with:
197-
name: ${{ env.ARTIFACT_NAME }}
198+
pattern: ${{ env.ARTIFACT_NAME }}-*
199+
merge-multiple: true
198200
path: ${{ env.DIST_DIR }}
199201

200202
- name: Prepare PATH
@@ -222,12 +224,12 @@ jobs:
222224
"${{ 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 }}"
223225
224226
- name: Upload artifacts
225-
uses: actions/upload-artifact@v3
227+
uses: actions/upload-artifact@v4
226228
env:
227229
MSI_FILE: ${{ steps.buildmsi.outputs.msi }}
228230
with:
229231
if-no-files-found: error
230-
name: ${{ env.ARTIFACT_NAME }}
232+
name: ${{ env.ARTIFACT_NAME }}-windows-installer
231233
path: ${{ env.MSI_FILE }}
232234

233235
create-release:
@@ -246,9 +248,10 @@ jobs:
246248
uses: actions/checkout@v4
247249

248250
- name: Download artifact
249-
uses: actions/download-artifact@v3
251+
uses: actions/download-artifact@v4
250252
with:
251-
name: ${{ env.ARTIFACT_NAME }}
253+
pattern: ${{ env.ARTIFACT_NAME }}-*
254+
merge-multiple: true
252255
path: ${{ env.DIST_DIR }}
253256

254257
- name: Install Task

.github/workflows/sync-labels.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ jobs:
7171
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7272

7373
- name: Pass configuration files to next job via workflow artifact
74-
uses: actions/upload-artifact@v3
74+
uses: actions/upload-artifact@v4
7575
with:
7676
path: |
7777
*.yaml
7878
*.yml
7979
if-no-files-found: error
80-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
80+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }}
8181

8282
sync:
8383
needs: download
@@ -109,13 +109,14 @@ jobs:
109109
uses: actions/checkout@v4
110110

111111
- name: Download configuration files artifact
112-
uses: actions/download-artifact@v3
112+
uses: actions/download-artifact@v4
113113
with:
114-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114+
pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-*
115+
merge-multiple: true
115116
path: ${{ env.CONFIGURATIONS_FOLDER }}
116117

117118
- name: Remove unneeded artifact
118-
uses: geekyeggo/delete-artifact@v2
119+
uses: geekyeggo/delete-artifact@v5
119120
with:
120121
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
121122

.github/workflows/test-go-task.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ jobs:
114114
mv coverage_integration.txt coverage_integration_${{ matrix.operating-system }}_${{ matrix.tests }}.txt
115115
116116
- name: Upload coverage data to workflow artifact
117-
uses: actions/upload-artifact@v3
117+
uses: actions/upload-artifact@v4
118118
with:
119119
if-no-files-found: error
120-
name: ${{ env.COVERAGE_ARTIFACT }}
120+
name: ${{ env.COVERAGE_ARTIFACT }}-test-integration-${{ matrix.operating-system }}-${{ matrix.tests }}
121121
path: |
122122
./coverage_integration_*.txt
123123
@@ -157,10 +157,10 @@ jobs:
157157

158158
- name: Upload coverage data to workflow artifact
159159
if: runner.os == 'Linux'
160-
uses: actions/upload-artifact@v3
160+
uses: actions/upload-artifact@v4
161161
with:
162162
if-no-files-found: error
163-
name: ${{ env.COVERAGE_ARTIFACT }}
163+
name: ${{ env.COVERAGE_ARTIFACT }}-test-${{ matrix.operating-system }}
164164
path: |
165165
./coverage_unit.txt
166166
@@ -182,9 +182,10 @@ jobs:
182182
run: go install github.com/wadey/gocovmerge@b5bfa59
183183

184184
- name: Download coverage data artifact
185-
uses: actions/download-artifact@v3
185+
uses: actions/download-artifact@v4
186186
with:
187-
name: ${{ env.COVERAGE_ARTIFACT }}
187+
pattern: ${{ env.COVERAGE_ARTIFACT }}-*
188+
merge-multiple: true
188189

189190
- name: Merge all code coverage artifacts
190191
run: gocovmerge coverage*.txt > coverage.txt

0 commit comments

Comments
 (0)