Commit c7093412 by Cuong Tran

fix: github actions to publish to RubyGems

parent 923c70ff
...@@ -3,6 +3,8 @@ on: ...@@ -3,6 +3,8 @@ on:
push: push:
tags: tags:
- 'v*' - 'v*'
branches:
- 'release/*'
jobs: jobs:
release: release:
...@@ -13,9 +15,9 @@ jobs: ...@@ -13,9 +15,9 @@ jobs:
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Setup Ruby - name: Setup Ruby
uses: actions/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 2.6.x ruby-version: '2.6'
- name: Bundle - name: Bundle
run: | run: |
...@@ -23,14 +25,13 @@ jobs: ...@@ -23,14 +25,13 @@ jobs:
gem update bundler gem update bundler
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- name: Publish to GPR - name: Publish to RubyGems
run: | run: |
mkdir -p $HOME/.gem mkdir -p $HOME/.gem
touch $HOME/.gem/credentials touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem gem push *.gem
env: env:
GEM_HOST_API_KEY: ${{ secrets.GPR_AUTH_TOKEN }} GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
OWNER: ctran
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment