Merge pull request #33 from paywith/update-with-original-repo #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Ruby Gem | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'lib/active_merchant/version.rb' | |
jobs: | |
build: | |
name: Build + Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby 3.0.5 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.5 | |
- name: set gem config | |
env: | |
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" | |
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 | |
- name: set git config | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: build gem and create a git tag | |
env: | |
REMOTE: "https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git" | |
run: gem_push=no rake -f Rakefile.gem_helper release[${REMOTE}] | |
- name: publish gem to Github Package Registry | |
env: | |
PACKAGE_REGISTRY: "https://rubygems.pkg.github.com/${{github.repository_owner}}" | |
run: gem push --KEY github --host ${PACKAGE_REGISTRY} pkg/$(ls pkg/) |