-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(publish-release): race between release view
and release create
#551
Comments
Hit this in The https://github.com/exercism/configlet/runs/7157826327
|
Ah, race conditions. Fun. |
Before this commit, the publish-release script handled both: - creating the draft release - uploading assets to the release with the intention that the first build job to finish would create the release with one asset, and each later job would upload an asset. The logic was like: if ! gh release view "${build_tag}"; then gh release create [...] else gh release upload [...] fi But this had a race. For example, if two build jobs finished at nearly the same moment, they could each create a draft release. This race was almost never encountered in practice, and was easily resolved by deleting a draft release and restarting a build job, but it's worth resolving. Add an initial build job to create a draft release that has no assets, and make the later build jobs only upload to that release. This fixes the race, and makes it easier to share logic between the native build jobs and the cross-compiling build jobs. Fixes: #551 Refs: #789
Follow-up from something I noticed in #550. There's a race condition here:
configlet/.github/bin/publish-release
Lines 5 to 9 in 4ddb23d
@ee7 wrote:
One possible way to resolve this is to ensure that
gh release create
can only run once:actions/upload-artifact
only.actions/download-artifact
, and then runsgh release create
.The text was updated successfully, but these errors were encountered: