Skip to content

Commit

Permalink
Switch to RubyGems Trusted publishing in CI release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Apr 27, 2024
1 parent 7652e99 commit 8dfa8e7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release gem to RubyGems
name: Build and release gem

on:
push:
Expand All @@ -8,13 +8,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.3"
- name: "Extract data from tag: version, message, body"
id: tag
run: |
Expand Down Expand Up @@ -75,8 +79,8 @@ jobs:
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
run: |
gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
- name: Configure RubyGems Credentials
uses: rubygems/configure-rubygems-credentials@main
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
run: |
gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem

0 comments on commit 8dfa8e7

Please sign in to comment.