# Releasing Ruby Gems with OIDC and GitHub Actions

DevFeed: [Releasing Ruby Gems with OIDC and GitHub Actions](<https://devfeed.tech/articles/releasing-ruby-gems-with-oidc-and-github-actions-122503.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/11/07/releasing-ruby-gems-with-oidc-and-github-actions.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-11-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [project release](<https://devfeed.tech/topics/project-release.md>), [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [rubygems](<https://devfeed.tech/topics/rubygems.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>)

Tags: [github-actions](<https://devfeed.tech/tags/github-actions.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

ruby-gem-release automates Ruby gem release bookkeeping through Ruby tasks and a reusable GitHub Actions workflow. RubyGems Trusted Publishing provides short-lived credentials, avoiding a stored RubyGems API key; after setup, collaborators with write access can dispatch releases. The example reads the version from a Ruby constant, dates the changelog before publishing, then increments the version and adds a "Next" section. It supports Intridea and Keep a Changelog formats. First publication requires configuring a trusted publisher and passing the numeric RubyGems account ID; later releases omit that input. For customization, Ruby callbacks expose steps such as changelog preparation, building and publishing the gem, Git tagging, and GitHub release creation as ordinary methods that can be tested.

## Source excerpt

The traditional approach for automating Ruby gem releases is to use release-gem. It's super simple. You can also build upon it when you need something beyond the plain rake release, such as updating a CHANGELOG.md, by rolling miles of brittle GitHub Actions YAML and shell script AI slop. Instead, I've been asking AI to follow a hand-crafted RELEASING.md. It can run tests, date CHANGELOG.md, ask me for a RubyGems OTP, make the release, increment the version of the next developer iteration. This works well. Still, AI is a very blunt tool for something that should be mechanized. Therefore, I built ruby-gem-release to automate all release bookkeeping in Ruby in an extensible workflow. The release runs in GitHub Actions. RubyGems Trusted Publishing supplies short-lived credentials, so there is no RubyGems API key to store in GitHub secrets or share with other maintainers. After setup, collaborators with write access can dispatch releases too. As an example, I added it to ruby-link-checker. Here's the Rakefile addition: require 'ruby-gem-release/workflow/ruby_gem' require 'ruby-gem-release/changelog' RubyGemRelease::Workflow::RubyGem.new( version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/ruby-link-checker/version.rb', constant: 'VERSION'), changelog: RubyGemRelease::Changelog::Intridea.new(placeholder: '* Your contribution here.') ).install_tasks The version strategy reads a constant from lib/ruby-link-checker/version.rb: module LinkChecker VERSION = '0.5.0'.freeze end The CHANGELOG.md in this project is in the Intridea style. The gem also supports Keep a Changelog. Before publishing 0.5.0 the CHANGELOG.md is updated with a date. After publishing, the VERSION constant is incremented to 0.5.1, and CHANGELOG.md is updated with a Next section. Add .github/workflows/release.yml to call the reusable release workflow. The optional rubygems-owner input accepts your numeric RubyGems account ID when publishing a new gem for the first time: name: Release on: workflow_di