Add a create-release action - #7
Merged
Merged
Conversation
Tags a commit and opens a draft GitHub release with artifacts attached. Always a draft: publishing stays a human act, so nothing here publishes and nothing here decides a version. The caller has already bumped whatever holds the version and committed that, so this tags what is in front of it. target exists because the commit to tag is the one carrying the regenerated files, not the one that only bumped the version -- tag the wrong one and the archive ships metadata describing the previous release. It refuses to run if the tag or the release already exists, and fails on an artifact that is missing or zero bytes. A release whose files are empty looks fine until someone downloads one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tags a commit and opens a draft GitHub release with artifacts attached.
Always a draft. Publishing stays a human act — someone reads the notes,
checks the artifacts and presses the button. Nothing here publishes, and
nothing here decides a version: the caller has already bumped whatever holds
it and committed that, so this tags what is in front of it.
targetDefaults to
HEAD, but exists because the commit worth tagging is usually notthe one that bumped the version. Where a release regenerates metadata from a
version field, the tag belongs on the commit carrying the regenerated files —
otherwise the archive ships metadata describing the previous release.
Refusals
It stops rather than producing something that looks fine and is not:
healthy until someone downloads one
Tested
Against a scratch repository: the dry run prints the exact
gh release createit would run; a missing
--tagexits 2; a missing artifact, an empty artifactand an existing tag each exit 1.
shellcheck --severity=styleis clean, andthe README-documents-every-input check passes for all seven actions.
For the terminal
bin/create-release.shis the implementation and the action is a wrapper, sothe same thing runs from a maintainer's own shell with
ghauthenticated asthem. That is the point of keeping the logic in a script — see
ADR-0005.
Note on releasing this
A caller in
caltechlibrary/CL-web-componentsusescreate-release@v1, sothis needs a release and a
v1move before that caller works. The changelogentry is under
[Unreleased].