2019-08-13 12:55:45 -04:00
|
|
|
name: Ruby Gem
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2020-07-13 12:12:41 -07:00
|
|
|
branches: [ $default-branch ]
|
2020-02-12 13:26:01 -05:00
|
|
|
pull_request:
|
2020-07-13 12:12:41 -07:00
|
|
|
branches: [ $default-branch ]
|
2019-08-13 12:55:45 -04:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
name: Build + Publish
|
|
|
|
|
runs-on: ubuntu-latest
|
2021-03-02 19:59:19 -06:00
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
2019-08-13 12:55:45 -04:00
|
|
|
|
|
|
|
|
steps:
|
2019-12-24 14:22:22 -08:00
|
|
|
- uses: actions/checkout@v2
|
2019-08-13 12:55:45 -04:00
|
|
|
- name: Set up Ruby 2.6
|
|
|
|
|
uses: actions/setup-ruby@v1
|
|
|
|
|
with:
|
2020-07-10 11:25:05 +01:00
|
|
|
ruby-version: 2.6.x
|
2019-08-13 12:55:45 -04:00
|
|
|
|
|
|
|
|
- name: Publish to GPR
|
|
|
|
|
run: |
|
|
|
|
|
mkdir -p $HOME/.gem
|
|
|
|
|
touch $HOME/.gem/credentials
|
|
|
|
|
chmod 0600 $HOME/.gem/credentials
|
2020-07-10 11:15:29 +01:00
|
|
|
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
2019-08-13 12:57:25 -04:00
|
|
|
gem build *.gemspec
|
2019-08-13 12:55:45 -04:00
|
|
|
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
|
|
|
|
env:
|
2020-07-10 10:55:13 +01:00
|
|
|
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
2020-07-10 11:12:02 +01:00
|
|
|
OWNER: ${{ github.repository_owner }}
|
2019-08-13 12:55:45 -04:00
|
|
|
|
|
|
|
|
- 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
|
2019-08-13 12:57:25 -04:00
|
|
|
gem build *.gemspec
|
2019-08-13 12:55:45 -04:00
|
|
|
gem push *.gem
|
|
|
|
|
env:
|
2020-09-17 17:11:19 +02:00
|
|
|
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|