Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Make manifest releases almost atomic using draft releases #19593
Per https://developer.github.com/v3/repos/releases/#create-a-release, `target_commitish` is used to create the tag, and ignored if the tag already exists.
This makes tagging and releasing almost atomic, at most leaving behind a draft release if something goes wrong. Because no tag or (non-draft) release will be created in case of error, the script can just be run again without first removing the bad release.
There are two commit on this branch where the first one would make sense in isolation and for review I recommend reading each commit message:
To gain some confidence that this works I make some local edits to the script to release to my fork, and emulated something going wrong when the .zst file was going to be uploaded. Here's the resulting draft release and the successful release once I removed the fake error:
I've confirmed that no tag is created for drafts, even though you can't tell from the state of my repo right now.