name: Release to RubyGems on: release: types: [published] jobs: release: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - name: Install Ruby and gems uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 with: bundler-cache: true ruby-version: "3.2" - name: Publish gem run: | umask 077 mkdir -p "$HOME/.gem" printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials gem build *.gemspec gem push *.gem rm -f "$HOME/.gem/credentials" env: RUBYGEMS_API_KEY: "${{secrets.RUBYGEMS_PUSH_API_KEY}}"