Skip to content

Commit

Permalink
Set up automatic publishing to Github and Rubygems (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlarraz authored Dec 21, 2020
1 parent 4912a87 commit b73a345
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Ruby Gem

on:
release:
types:
- published

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- name: Build
run: |
gem build *.gemspec
- name: Publish to Github
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push --verbose --key github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}
- name: Publish to RubyGems
run: |
gem push --verbose *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_TOKEN}}

0 comments on commit b73a345

Please sign in to comment.