Skip to content

Add release workflow to automate gem publishing#448

Draft
sinsoku wants to merge 1 commit intoruby:masterfrom
sinsoku:add-release-workflow
Draft

Add release workflow to automate gem publishing#448
sinsoku wants to merge 1 commit intoruby:masterfrom
sinsoku:add-release-workflow

Conversation

@sinsoku
Copy link
Copy Markdown
Collaborator

@sinsoku sinsoku commented May 4, 2026

Motivation / Background

I want to increase the release frequency by automating the gem release process.

Detail

Allow publishing a new version to RubyGems simply by merging a release PR.
tagpr handles release PR creation and tagging, and rubygems/release-gem pushes the gem.

Required setup (cc: @mame)

Several settings are required for this workflow to work.

How the release flow works

  1. When a commit is pushed to master, tagpr opens (or updates) a release PR
    titled something like Release for vX.Y.Z. The PR contains:
    • A version bump in lib/typeprof/version.rb
    • An updated Gemfile.lock (via postVersionCommand)
    • An auto-generated CHANGELOG.md entry summarizing merged PRs since
      the last release
  2. The next version defaults to a patch bump. To bump minor/major, use either:
    • Label a merged PR with minor or major — tagpr will automatically
      propagate this to the release PR as tagpr:minor / tagpr:major, or
    • Label the release PR directly with tagpr:minor or tagpr:major
      to override / set the bump manually.
  3. Merging the release PR causes tagpr to push a vX.Y.Z tag and create a
    GitHub Release.
  4. The tag triggers rubygems/release-gem, which builds and pushes the gem
    to RubyGems via Trusted Publishing (no API key needed).

Examples

Allow publishing a new version to RubyGems simply by merging a release PR.
tagpr handles release PR creation and tagging, and rubygems/release-gem pushes the gem.

refs:
* https://github.com/Songmu/tagpr
* https://guides.rubygems.org/trusted-publishing/
@mame
Copy link
Copy Markdown
Member

mame commented May 5, 2026

I checked the repository settings, and "Allow GitHub Actions to create and approve pull requests" appears to be disabled at the enterprise level. So I cannot enable it soon.
I can't tell whether this is intentional, so I'll discuss it with @hsbt after the holidays.

@sinsoku
Copy link
Copy Markdown
Collaborator Author

sinsoku commented May 6, 2026

@mame
I investigated why this setting is disabled by default.
It seems to be to reduce the risk of malicious code being introduced by bypassing code reviews.

The impact is limited because tagpr only creates a release PR.
However, I'm hesitant to change the organization's settings for this workflow.

I'll consider if there's a better way.

@sinsoku sinsoku marked this pull request as draft May 6, 2026 15:38
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.

2 participants