Skip to content

Instantly share code, notes, and snippets.

@skalibog
Created October 22, 2023 07:40
Show Gist options
  • Save skalibog/ba75d251f73c50f2696ac53b4fbf7fda to your computer and use it in GitHub Desktop.
Save skalibog/ba75d251f73c50f2696ac53b4fbf7fda to your computer and use it in GitHub Desktop.
GA for automation gem release.
name: Release
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake
- name: publish gem
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
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment