Skip to content

Commit 12f69f4

Browse files
committed
Add Release GitHub Actions workflow
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)
1 parent 8a0c981 commit 12f69f4

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: Release to RubyGems
10+
permissions:
11+
contents: write
12+
id-token: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checout@v4
16+
- uses: ruby/setup-ruby@v1
17+
with:
18+
bundler-cache: true
19+
ruby-version: ruby
20+
- uses: rubygems/release-gem@v1

0 commit comments

Comments
 (0)