Skip to content

Commit

Permalink
Update gem-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle authored Oct 31, 2024
1 parent 6af5d1a commit 2171bcd
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@ name: Ruby Gem
on: workflow_dispatch

jobs:
build:
name: Build + Publish
push:
name: Push gem to RubyGems.org
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag

steps:
- uses: actions/checkout@v4
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
# Set up
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
# Release
- uses: rubygems/release-gem@v1

0 comments on commit 2171bcd

Please sign in to comment.