Skip to content

Commit d0fcc98

Browse files
committed
Use more efficient release artifact replacement approach
The "Release" GitHub Actions workflow automatically generates releases of the project. This is done for a range of host architectures, including macOS. The macOS builds are then put through a notarization process in a dedicated workflow job. The builds are transferred between jobs by GitHub Actions workflow artifacts. The "create-release-artifacts" job produces macOS workflow artifacts containing non-notarized builds, which must then be replaced after the builds are notarized by the "notarize-macos" job. Previously, the approach chosen to accomplish this replacement was to use the community created "geekyeggo/delete-artifact" action to delete each artifact after it had been downloaded by the "notarize-macos" job, then replacing it by uploading the notarized version using the "actions/upload-artifact" action. The ability to overwrite workflows was recently added to the "actions/upload-artifact" action. This behavior is enabled by setting the action's `overwrite` input to `true`. By using this feature, we avoid the need to delete the artifact and thus the dependence on the "geekyeggo/delete-artifact" action is avoided, making the workflow more simple, easier to maintain, and more secure.
1 parent 2a92970 commit d0fcc98

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ jobs:
120120
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
121121
path: ${{ env.DIST_DIR }}
122122

123-
- name: Remove non-notarized artifact
124-
uses: geekyeggo/delete-artifact@v5
125-
with:
126-
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
127-
128123
- name: Import Code-Signing Certificates
129124
env:
130125
KEYCHAIN: "sign.keychain"
@@ -190,11 +185,12 @@ jobs:
190185
chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"
191186
tar -czvf "${{ env.PACKAGE_FILENAME }}" "${{ env.BUILD_FOLDER }}/"
192187
193-
- name: Upload notarized artifact
188+
- name: Replace artifact with notarized build
194189
uses: actions/upload-artifact@v4
195190
with:
196191
if-no-files-found: error
197192
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
193+
overwrite: true
198194
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
199195

200196
create-release:

0 commit comments

Comments
 (0)