Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up automatic publishing to Github and Rubygems #275

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}