Skip to content

ci: publish the gem through RubyGems Trusted Publishing - #110

Merged
mogita merged 1 commit into
masterfrom
ci/rubygems-trusted-publishing
Nov 16, 2026
Merged

mogita merged 1 commit into
masterfrom
ci/rubygems-trusted-publishing

Conversation

@mogita

@mogita mogita commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Problem

The publish job pushes the gem with the RUBYGEMS_API_KEY repo secret, a long-lived key that has to go after the secret rotation.

Solution

  • Grant the publish job id-token: write and add rubygems/configure-rubygems-credentials (v2.1.0, pinned by SHA). It trades the job's OIDC token for a short-lived GEM_HOST_API_KEY.
  • The gem has a matching trusted publisher on rubygems.org for this repo and release.yml.

How to verify

  1. The next release publishes the gem without the secret.
  2. After merge, delete the repo secret RUBYGEMS_API_KEY.

The publish job trades its OIDC token for a short-lived API key, so the release no longer needs the RUBYGEMS_API_KEY secret.
@mogita
mogita merged commit 3a510fb into master Nov 16, 2026
7 checks passed
@mogita
mogita deleted the ci/rubygems-trusted-publishing branch November 16, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant