A minimal Ruby gem for testing trusted publishing on rubygems.org.
This gem exists solely to test the trusted publishing workflow, which allows publishing gems to RubyGems.org from GitHub Actions without requiring API keys.
- 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:
To publish a new version:
- Update the version in
lib/trusted_publishing_test/version.rb - Commit the changes
- Create and push a git tag:
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)
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 installOr install it yourself as:
gem install trusted_publishing_testrequire 'trusted_publishing_test'
TrustedPublishingTest.hello
# => "Hello from Trusted Publishing Test gem v0.1.0!"MIT