Ruby (RubyGems)
RubyGems publishing uses an API key. The release workflow pushes the gem with that key.
Enable publishing#
{
"targets": {
"ruby": {
"gemName": "acme",
"publish": { "rubygems": true }
}
}
}Set up the API key#
1
Create a RubyGems API key
On rubygems.org, create an API key with the Push rubygem scope. Scope it to your gem once it exists.
2
Add it to the repository
Add the key as a repository secret named RUBYGEMS_API_KEY. See Adding repository secrets.
The workflow reads it as GEM_HOST_API_KEY when running gem push.
Notes#
- The workflow checks the RubyGems API for the version first and skips
gem pushif it is already published, so re-merges are safe.