Use more efficient workflow artifact replacement approach #529
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "Release" workflow (Go, Task, Crosscompile) template uses a GitHub Actions workflow to automatically generate releases of a 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 thenotarize-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. It turns out that the ability to overwrite workflows was recently added to the actions/upload-artifact action, in 4.2.0: actions/upload-artifact@11ff42c. This behavior is enabled by setting the action'soverwrite
input totrue
. By using this feature, the dependence on the geekyeggo/delete-artifact action can be avoided, making the workflow more simple, easier to maintain, and more secure.