.github/workflows/publish-gem.yml

Summary

Maintainability
Test Coverage
name: Push to rubygems.org

on:
  workflow_dispatch:
    inputs:
      rubygems-otp-code:
        description: RubyGems OTP code
        required: true
        type: string

jobs:
  release:
    runs-on: ubuntu-latest
    env:
      GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
      GEM_HOST_OTP_CODE: ${{ github.event.inputs.rubygems-otp-code }}
    steps:
    - uses: actions/checkout@v4
      with:
          fetch-depth: 0

    - uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true

    - name: config
      run: |
        git config --global user.name "${GITHUB_ACTOR}"
        git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

    - name: release
      run: bundle exec rake release