Skip to content

Commit

Permalink
Update CI release workflow to use RubyGems Trusted publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Jan 4, 2024
1 parent 2369085 commit 42ade4e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: 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.2
- name: "Extract data from tag: version, message, body"
id: tag
run: |
Expand Down Expand Up @@ -75,8 +78,8 @@ jobs:
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
run: |
gem push yabeda-prometheus-${{ 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-prometheus-${{ steps.tag.outputs.version }}.gem

0 comments on commit 42ade4e

Please sign in to comment.