v0.3.2 #40
Workflow file for this run
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: Publish Gem | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
- name: Release Gem | |
if: contains(github.ref, 'refs/tags/v') | |
env: | |
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} | |
TAG: ${{ github.event.release.tag_name }} | |
run: | | |
echo "Setting up gem credentials..." | |
mkdir -p ~/.gem | |
cat << EOF > ~/.gem/credentials | |
--- | |
:rubygems_api_key: ${RUBYGEMS_API_KEY} | |
EOF | |
chmod 0600 ~/.gem/credentials | |
bundle exec rake build | |
echo "Running gem release task..." | |
gem push pkg/phi_attrs-${TAG#v}.gem |