Trusted Publishing Test
A minimal Ruby gem for testing trusted publishing on rubygems.org.
Purpose
This gem exists solely to test the trusted publishing workflow, which allows publishing gems to RubyGems.org from GitHub Actions without requiring API keys.
Setup
1. Configure Trusted Publishing on RubyGems.org
- Log in to rubygems.org
- Navigate to your gem's page (or create a new gem)
- Go to Settings > Trusted Publishing
- Add a new trusted publisher with:
- Repository owner:
RubyGemsOrg - Repository name:
trusted-publishing-test - Workflow filename:
publish.yml - Environment name: (leave empty unless using GitHub environments)
- Repository owner:
2. Create a Release
To publish a new version:
- Update the version in
lib/trusted_publishing_test/version.rb - Commit the changes
- Create and push a git tag:
bash git tag v0.1.0 git push origin v0.1.0
The GitHub Actions workflow will automatically:
- Build the gem
- Publish it to RubyGems.org using trusted publishing (no API key required)
Installation
You probably don't want to install this, but in case you do: Add this line to your application's Gemfile:
gem 'trusted_publishing_test'
And then execute:
bundle install
Or install it yourself as:
gem install trusted_publishing_test
Usage
require 'trusted_publishing_test'
TrustedPublishingTest.hello
# => "Hello from Trusted Publishing Test gem v0.1.0!"
License
MIT