1.0.0 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| # Publishes the gem to RubyGems when a GitHub Release is published. | |
| # Uses RubyGems Trusted Publishing (OIDC) — no API key is stored in the repo. | |
| # | |
| # This builds and pushes the gem directly (no `rake release` / git tagging), | |
| # because the GitHub Release already created the tag. | |
| # | |
| # One-time setup on rubygems.org (Gem → Ownership/Trusted Publishers, or a | |
| # "pending" trusted publisher before the first push): | |
| # - Repository: testingbot/testingbot_ruby | |
| # - Workflow filename: release.yml | |
| # - Environment: leave blank | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: Build and publish gem | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # request the OIDC token for Trusted Publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Unit tests (gate) | |
| run: bundle exec rake unit | |
| - name: Configure RubyGems trusted publishing (OIDC) | |
| uses: rubygems/configure-rubygems-credentials@v2.0.0 | |
| - name: Build gem | |
| run: gem build testingbot.gemspec | |
| - name: Push to RubyGems | |
| run: gem push testingbot-*.gem |