Repository navigation
Cut releases from the GitHub Releases UI - #12
Merged
Merged
Conversation
The Release workflow triggered on `push: tags` and created the GitHub
release itself, so publishing v0.1.0 from the Releases UI failed: the gem
pushed to RubyGems, then the run went red on `gh release create` with
`HTTP 422 Release.tag_name already exists`.
Trigger on `release: published` instead and drop the release-creation
step, since the release already exists by the time the workflow fires.
Read the tag from `github.event.release.tag_name` rather than
`GITHUB_REF_NAME`, and check out that tag explicitly. The version-vs-tag
guard stays, so a release tagged without the `v` prefix now fails the
guard instead of silently not triggering anything.
Drop `contents: write` from the publishing job. GitHub creates the tag
before the workflow runs, so bundler's `release:source_control_push`
(`tag_version { git_push } unless already_tagged?`) always takes the
already-tagged branch and never pushes.
Release notes now come from Generate release notes in the UI, so point
each CHANGELOG.md heading at its GitHub release instead of feeding the
notes from that file. The headings were already reference links with no
definitions, so they rendered as literal brackets. Also correct the
0.1.0 date to the day it actually published.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
Publishing
v0.1.0from the Releases UI half-failed. The gem pushed to RubyGems fine, then the run went red on the last step:The workflow triggered on
push: tagsand created the GitHub release itself, so when the release came from the UI it was trying to create one that already existed. Nothing is broken on RubyGems — 0.1.0 is live — but the workflow did the opposite of the intended flow.What changed
release: publishedinstead ofpush: tags, and drop the release-creation step. The release already exists by the time the workflow fires.github.event.release.tag_namerather thanGITHUB_REF_NAME, and check out that tag explicitly.contents: write→contents: readon the publishing job. GitHub creates the tag before the workflow runs, so bundler'srelease:source_control_push—tag_version { git_push } unless already_tagged?— always takes the already-tagged branch and never pushes. Worth tightening because this job holds the OIDC publishing credentials.CHANGELOG.mdnow links to each release, since Generate release notes is the preferred source of notes. The## [x.y.z]headings were already reference links with no definitions, so they were rendering as literal brackets; this adds the definitions. Also corrects the 0.1.0 date to the day it actually published.git tag && git pushsteps were wrong.The version-vs-tag guard stays. Note it now behaves differently on a missing
vprefix: the oldtags: ["v*"]glob meant a bare0.2.0tag triggered nothing at all, whereas now it triggers and fails the guard before publishing. Same outcome, clearer failure.Verification
The parts that can be checked without cutting a release:
releaseenvironment are confirmed working end-to-end by the v0.1.0 run — only the release-creation step failed.contents: readverified against the installed bundler'sgem_helper.rb, not from memory, and corroborated by the v0.1.0 run's push step succeeding with a UI-created tag already present.bundle exec rake spec→ 19 examples, 0 failures. Nothing underlib/was touched.What can't be verified until it merges:
release: publishedwon't fire from a branch, and GitHub resolvesrelease.ymlfrom the commit the release points at — so the next release has to be cut after this is onmaster.🤖 Generated with Claude Code