Skip to content

Commit

Permalink
Add Release GitHub Actions workflow
Browse files Browse the repository at this point in the history
This commit 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 [1].

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 [2] or by using the GitHub CLI:

```sh
gh release create v0.1.0 --generate-notes
```

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 [3] on #3.

[1] https://guides.rubygems.org/trusted-publishing/releasing-gems/
[2] https://github.com/github-community-projects/graphql-client/releases
[3] #3 (comment)
  • Loading branch information
jgarber623 committed Jan 30, 2024
1 parent 8a0c981 commit 12f69f4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: Release to RubyGems
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
- uses: rubygems/release-gem@v1

0 comments on commit 12f69f4

Please sign in to comment.