Skip to content

Commit cc515d5

Browse files
committed
ci: automate gem releases
Publish tagged releases through RubyGems trusted publishing after every database and static check passes. Keep the OIDC publisher in ci.yml so it matches the registered workflow identity.
1 parent 256233f commit cc515d5

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,38 @@ jobs:
7878
ruby-version: "3.3"
7979
bundler-cache: true
8080
- run: bundle exec rake standard rubocop rbs steep security
81+
82+
release:
83+
if: startsWith(github.ref, 'refs/tags/v')
84+
needs:
85+
- sqlite
86+
- postgresql
87+
- mysql
88+
- static
89+
runs-on: ubuntu-latest
90+
permissions:
91+
contents: write
92+
id-token: write
93+
steps:
94+
- uses: actions/checkout@v7
95+
with:
96+
persist-credentials: false
97+
- uses: ruby/setup-ruby@v1
98+
with:
99+
ruby-version: "3.3"
100+
bundler-cache: true
101+
- name: Verify release tag
102+
run: |
103+
version=$(ruby -Ilib -e 'require "solid_objects/version"; print SolidObjects::VERSION')
104+
test "$GITHUB_REF_NAME" = "v$version"
105+
- name: Build gem
106+
run: gem build solid_objects.gemspec
107+
- name: Configure RubyGems credentials
108+
uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a
109+
- name: Push to RubyGems
110+
run: gem push solid_objects-*.gem
111+
- name: Create GitHub release
112+
uses: softprops/action-gh-release@v2
113+
with:
114+
files: solid_objects-*.gem
115+
generate_release_notes: true

0 commit comments

Comments
 (0)