Closed jgarber623 closed 9 months ago
Oh! Also maybe worth noting:
rubygems_mfa_required
setting to this gem's metadata (documentation) and requiring all owners to enable MFA on their RubyGems account.🎉 0.20.0 is published with MFA from GitHub Actions. Thanks for this improvement! https://rubygems.org/gems/graphql-client/versions/0.20.0
@rmosolgo Thats great news! Glad I could help out.
Description
This PR adds a GitHub Actions workflow that will build and publish a new version of the gem to RubyGems. The workflow follows the pattern described in RubyGems' "Trusted Publishing" documentation.
The workflow is triggered whenever a new Release is published by anyone with permissions to do so on the project's GitHub repository. This should work for pre-release versions, as well.
Releases may be created via the website or by using the GitHub CLI:
Being sure to swap out
v0.1.0
with an appropriate (new or existing) tag, of course. Note that draft releases and/or editing existing releases will not re-trigger this workflow.This commit follows up on my question/comment on #3.
RubyGems Owner To-Do
In order to enable this workflow, a gem owner (@rmosolgo, that'd be you!) will need to configure a Trusted Publisher on RubyGems. This tutorial outlines the necessary steps.
That should be it on the RubyGems side of things.
Suggested Improvement
I didn't add this in the PR, but:
On some of my projects, I re-run my CI workflow before running the job that releases a gem as a last-minute backstop against anything strange happening. You can see that in action in this workflow file (reproduced and modified here):
The
ci.yml
workflow would need a small update to its trigger configuration to support this:Relevant documentation:
on.workflow_call
Thanks!
Thanks for considering this change to this gem's workflow. Adopting this process should streamline the development cycle while also maintaining security and trust. Looking forward to your feedback.