Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork12
Commite2ee58f
committed
Fix collision between macOS workflow artifacts in release workflows
GitHub Workflows are used to automatically generate and publish production and nightly releases of the project. This isdone for a range of host architectures, including macOS. The macOS builds are then put through a notarization process ina dedicated workflow job.GitHub Actions workflow artifacts are used to transfer the generated files between sequential jobs in the workflow. The"actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose.The workflow artifact handling had to be reworked recently in order to handle a breaking change in the 4.0.0 release ofthe "actions/upload-artifact" action. Previously, a single artifact was used for the transfer of the builds for allhosts. 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 aredownloaded in aggregate in a subsequent job by using the artifact name globbing and merging features which wereintroduced in version 4.1.0 of the "actions/download-artifact" action.A regression was introduced at that time. The chosen approach was to use a separate set of artifacts for thenon-notarized and notarized files. An overview of the sequence (the prefixes are the workflow job names):1. create-release-artifacts/create-nightly-artifacts: Generate builds.2. create-release-artifacts/create-nightly-artifacts: Upload builds to workflow artifacts3. notarize-macos: Download workflow artifacts.4. notarize-macos: Notarize macOS build from downloaded artifact.5. notarize-macos: Upload notarized build to workflow artifact with a different name than the source artifact.6. create-release/publish-nightly: Download workflow artifacts.7. create-release/publish-nightly: Publish builds.The problem with this is that the artifacts for the non-notarized (uploaded by thecreate-release-artifacts/create-nightly-artifacts job) and notarized (created by the notarize-macos job) files are thendownloaded and merged by the create-release/publish-nightly job. Since each artifact contains a file with the same pathin the merged output, the contents of the last downloaded artifact overwrite the contents of the first. It happens thatthe non-notarized artifact is downloaded after the notarized artifact, so this file path collision results innon-notarized macOS builds being published instead of the notarized builds as intended, and as done by the workflowprior to the regression. For example, this bug was also present in the Arduino CLI repository and you can see the impacton its releases:```% wgethttps://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_macOS_ARM64.tar.gz[...]% tar -xf arduino-cli_nightly-latest_macOS_ARM64.tar.gz% spctl -a -vvv -t install arduino-cliarduino-cli: rejected``````% wgethttps://downloads.arduino.cc/arduino-cli/arduino-cli_latest_macOS_ARM64.tar.gz[..]% tar -xf arduino-cli_latest_macOS_ARM64.tar.gz% spctl -a -vvv -t install arduino-cliarduino-cli: rejected```The chosen solution is that, instead of using new artifacts for the notarized builds, to overwrite the same macOSartifacts containing the no-notarized builds, which were generated by thecreate-release-artifacts/create-nightly-artifacts job with the notarized builds from the notarize-macos jobs. This ismade possible by the overwriting capability of the "actions/upload-artifact" action (which was introduced in version4.2.0).An overview of the new sequence (the prefixes are the workflow job names):1. create-release-artifacts/create-nightly-artifacts: Generate builds.2. create-release-artifacts/create-nightly-artifacts: Upload builds to workflow artifacts3. notarize-macos: Download macOS x86 or Apple Silicon workflow artifact.5. notarize-macos: Notarize macOS build from downloaded artifact.6. notarize-macos: Upload notarized build to same workflow artifact, overwriting the non-notarized contents.7. create-release/publish-nightly: Download workflow artifacts.8. create-release/publish-nightly: Publish builds.1 parent4973a41 commite2ee58f
File tree
2 files changed
+14
-8
lines changed- .github/workflows
2 files changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
85 | 86 | | |
86 | | - | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
175 | | - | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | | - | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
181 | | - | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | | - | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| |||
0 commit comments
Comments
(0)