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 24, 2024
1 parent 67d4c93 commit 7970697
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 @@ -43,3 +43,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/[email protected]
- 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 @@ -44,3 +44,13 @@ desc "Run tests"
task :test do
ruby("test/run-test.rb")
end

release_task = Rake.application["release"]
# We use Trusting 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 7970697

Please sign in to comment.