Skip to content

Commit

Permalink
Set up automatic publishing to Github and Rubygems (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlarraz authored Jan 7, 2021
1 parent fd46b14 commit ba327b4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/gem-publish-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Public 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 }}
continue-on-error: true

- name: Publish to RubyGems
run: |
gem push --verbose *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_TOKEN}}

0 comments on commit ba327b4

Please sign in to comment.