Skip to content

Commit

Permalink
release: add support for Trusted Publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Dec 15, 2024
1 parent bc11345 commit 8df779e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ jobs:
--title "${title}"
env:
GH_TOKEN: ${{ github.token }}

rubygems:
name: RubyGems
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
environment: release
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- uses: rubygems/configure-rubygems-credentials@v1.0.0
- name: Push gems
run: |
bundle exec rake release:rubygem_push
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ end

desc "Run all benchmarks"
task :benchmark => benchmark_tasks

release_task = Rake.application["release"]
# We use Trusted Publishing.
release_task.prerequisites.delete("build")
release_task.prerequisites.delete("release:rubygem_push")
release_task_comment = release_task.comment
if release_task_comment
release_task.clear_comments
release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
end

0 comments on commit 8df779e

Please sign in to comment.