Skip to content

Commit 3289cb8

Browse files
committed
Don't upload multiple times to same artifact in release workflows
The release workflows produce binaries for a range of target hosts. This is done by using a job matrix in the GitHub Actions workflow that produces each build in a parallel job. GitHub Actions workflow artifacts are used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" action is used for this purpose. Previously, a single artifact was used for this purpose, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action.
1 parent 5b2faea commit 3289cb8

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Diff for: .github/workflows/publish-go-nightly-task.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
uses: actions/upload-artifact@v4
5757
with:
5858
if-no-files-found: error
59-
name: ${{ env.ARTIFACT_NAME }}
59+
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }}
6060
path: ${{ env.DIST_DIR }}
6161

6262
notarize-macos:
@@ -89,7 +89,8 @@ jobs:
8989
- name: Download artifacts
9090
uses: actions/download-artifact@v4
9191
with:
92-
name: ${{ env.ARTIFACT_NAME }}
92+
pattern: ${{ env.ARTIFACT_NAME }}-*
93+
merge-multiple: true
9394
path: ${{ env.DIST_DIR }}
9495

9596
- name: Import Code-Signing Certificates
@@ -166,7 +167,7 @@ jobs:
166167
uses: actions/upload-artifact@v4
167168
with:
168169
if-no-files-found: error
169-
name: ${{ env.ARTIFACT_NAME }}
170+
name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }}
170171
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
171172

172173
publish-nightly:
@@ -178,7 +179,8 @@ jobs:
178179
- name: Download artifact
179180
uses: actions/download-artifact@v4
180181
with:
181-
name: ${{ env.ARTIFACT_NAME }}
182+
pattern: ${{ env.ARTIFACT_NAME }}-*
183+
merge-multiple: true
182184
path: ${{ env.DIST_DIR }}
183185

184186
- name: Create checksum file

Diff for: .github/workflows/release-go-task.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
uses: actions/upload-artifact@v4
6464
with:
6565
if-no-files-found: error
66-
name: ${{ env.ARTIFACT_NAME }}
66+
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }}
6767
path: ${{ env.DIST_DIR }}
6868

6969
notarize-macos:
@@ -94,7 +94,8 @@ jobs:
9494
- name: Download artifacts
9595
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
@@ -171,7 +172,7 @@ jobs:
171172
uses: actions/upload-artifact@v4
172173
with:
173174
if-no-files-found: error
174-
name: ${{ env.ARTIFACT_NAME }}
175+
name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }}
175176
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
176177

177178
create-release:
@@ -184,7 +185,8 @@ jobs:
184185
- name: Download artifact
185186
uses: actions/download-artifact@v4
186187
with:
187-
name: ${{ env.ARTIFACT_NAME }}
188+
pattern: ${{ env.ARTIFACT_NAME }}-*
189+
merge-multiple: true
188190
path: ${{ env.DIST_DIR }}
189191

190192
- name: Create checksum file

0 commit comments

Comments
 (0)