Skip to content

Add RubyGems trusted publishing release workflow - #129

Merged
evolve75 merged 2 commits into
masterfrom
features/trusted-publishing
Jul 24, 2026
Merged

Add RubyGems trusted publishing release workflow#129
evolve75 merged 2 commits into
masterfrom
features/trusted-publishing

Conversation

@evolve75

Copy link
Copy Markdown
Owner

Summary

  • Add .github/workflows/release.yml, a tag-triggered (R*) workflow that publishes rubytree to RubyGems.org using trusted publishing (OIDC) instead of a stored API key
  • Guard the workflow so it refuses to publish if the tagged commit isn't reachable from master, since tag-push triggers can't be scoped to a branch directly

Context

RubyGems.org expired all legacy API keys after a CDN caching bug (GHSA-9j48-x3c3-mrp2) could replay one account's key to another request for up to an hour. This removes the need to store a long-lived RubyGems API key anywhere for future releases. A Trusted Publisher for evolve75/RubyTree / release.yml has already been configured on rubygems.org. The existing rake gem:push task (which also pushes to GitHub Packages) remains as a manual fallback.

Test plan

  • rake test:all passes on this branch
  • rake gem:package builds the gem successfully
  • Workflow YAML validated
  • End-to-end trusted-publishing verified on the next real tagged release (this PR itself does not trigger a publish — only a pushed R* tag does)

evolve75 added 2 commits July 24, 2026 19:25
RubyGems.org expired all legacy API keys after a CDN caching bug
(GHSA-9j48-x3c3-mrp2) could replay one account's key to another
request for up to an hour. Rather than storing a fresh long-lived
API key on a maintainer's machine, add a tag-triggered GitHub
Actions workflow that publishes to RubyGems.org via OIDC trusted
publishing, so no RubyGems credential needs to be held anywhere.

The existing `rake gem:push` task (which also pushes to GitHub
Packages) remains available as a manual fallback.

Requires a Trusted Publisher to be configured for the `rubytree`
gem at rubygems.org, pointing at this repository and workflow file.
Tag-push triggers in GitHub Actions can't be filtered by branch
directly, so a release tag pushed from any branch would still fire
the publish workflow. Add a step that verifies the tagged commit is
reachable from origin/master and fails before the build/publish
steps run if it isn't, so an accidental tag elsewhere can't trigger
a release.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 96.35%. remained the same — features/trusted-publishing into master

@evolve75
evolve75 merged commit 907eaa5 into master Jul 24, 2026
27 checks passed
@evolve75
evolve75 deleted the features/trusted-publishing branch July 24, 2026 23:48
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.

2 participants