Release v6.0.3 #5
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: Push gem to RubyGems | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| push: | |
| if: github.repository == 'httprb/http' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: rubygems.org | |
| url: https://rubygems.org/gems/http | |
| permissions: | |
| contents: write | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ruby: ruby | |
| platform: "" | |
| - ruby: jruby | |
| platform: java | |
| env: | |
| BUNDLE_WITHOUT: sig | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - uses: rubygems/configure-rubygems-credentials@v1.0.0 | |
| - name: Update RubyGems | |
| run: gem update --system | |
| - name: Build gem | |
| run: gem build http.gemspec | |
| env: | |
| HTTP_PLATFORM: ${{ matrix.platform }} | |
| # Sigstore signing always runs under CRuby. JRuby 10.0.5+'s | |
| # jruby-openssl 0.15.7 added tbs_bytes, which triggers a code | |
| # path in sigstore-ruby 0.2.3 that fails because JRuby's | |
| # OpenSSL returns the SCT extension OID as its dotted form | |
| # instead of the short name sigstore-ruby expects. | |
| - name: Set up CRuby for signing | |
| if: matrix.ruby != 'ruby' | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ruby | |
| - name: Sign gem with Sigstore | |
| run: | | |
| for gem in http-*.gem; do | |
| gem exec sigstore-cli sign "$gem" --bundle "${gem%.gem}.gem.sigstore.json" | |
| done | |
| - name: Push gem | |
| run: | | |
| for gem in http-*.gem; do | |
| gem push "$gem" --attestation "${gem%.gem}.gem.sigstore.json" || { | |
| echo "gem push failed — checking if already published" | |
| gem exec rubygems-await "$gem" && echo "Already published, continuing" || exit 1 | |
| } | |
| done | |
| - name: Wait for release | |
| run: gem exec rubygems-await http-*.gem | |
| env: | |
| HTTP_PLATFORM: ${{ matrix.platform }} | |
| - name: Create GitHub release | |
| if: matrix.ruby == 'ruby' | |
| run: | | |
| tag_name="$(git describe --tags --abbrev=0)" | |
| gh release view "${tag_name}" >/dev/null 2>&1 || \ | |
| gh release create "${tag_name}" --verify-tag --generate-notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |