Skip to content

Commit

Permalink
Create publish_to_rubygems.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofurtado committed Jun 22, 2021
1 parent 8328abc commit e28e93a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish_to_rubygems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to Rubygems

on:
release:
types: [created]

jobs:
publish-to-rubygems:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- name: Install dependencies
run: bundle install

- 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}}"

0 comments on commit e28e93a

Please sign in to comment.