This action allows you to automate releasing your gems to RubyGems.org.
This example jumps right into RubyGems.org's current recommended best practice.
This action supports RubyGems.org's trusted publishing implementation, which allows authenticating to RubyGems.org without manually configuring secrets. To perform trusted publishing with this action, your projects publisher must already be configured on RubyGems.org.
To enter the trusted publishing flow, configure this action's job with the
id-token: write
permission.
# .github/workflows/push_gem.yml
jobs:
push:
name: Push gem to RubyGems.org
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
steps:
# Set up
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
# Release
- uses: rubygems/release-gem@v1
For now, this action makes several assumptions about your project:
- Your workflow checks out the repository & configures a working Ruby environment
- Your project uses bundler to manage dependencies
- Your project has the bundler release tasks configured
- Your gem has trusted publishing configured on RubyGems.org