Skip to content

Release when a merge into main changes the gem version - #5

Merged
meganemura merged 1 commit into
mainfrom
release-on-version-bump
Oct 8, 2026
Merged

meganemura merged 1 commit into
mainfrom
release-on-version-bump

Conversation

@meganemura

Copy link
Copy Markdown
Owner

A release now takes one merge and one approval.

The Release workflow starts on a push to main that changes lib/hegel/version.rb:

  • check reads the gem version and looks for the tag v<version>. When the tag exists, as after a revert, the run stops.
  • publish waits for the release environment approval, then builds and pushes the gems from the merged commit, as before.
  • release creates the tag on the merged commit together with the GitHub release (gh release create --target).

A tag pushed with the workflow's own token would not start another workflow, so the tag comes last, after the gems are out. A rejected approval leaves no tag, and rerunning the run releases the same commit. ADR 0024 records the decision.

Checked locally: the check step prints "v0.2.0 already exists" for 0.2.0 and tag=v0.2.1 for the 0.2.1 in #4. The workflow itself first runs on the next merge that changes the version. Merge this before #4, so that merging #4 starts the 0.2.1 release.

🤖 Generated with Claude Code

A release took a merge, a hand-pushed tag, and an approval. The Release workflow now starts on a push to main that changes lib/hegel/version.rb. A check job stops the run when the tag for that version exists. The publish job waits for the release environment approval as before. The last job creates the tag on the merged commit together with the GitHub release.

A tag that the workflow pushed with its own token would not start another workflow, so the tag is the last thing created, after the gems are out. A rejected approval leaves no tag, and a rerun of the run releases the same commit. ADR 0024 records the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@meganemura
meganemura merged commit aee91ab into main Oct 8, 2026
11 checks passed
@meganemura
meganemura deleted the release-on-version-bump branch October 8, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant