name: publish-gem

on:
  push:
    tags:
      - v*

jobs:
  publish-gem:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.1'
          bundler-cache: true
      - name: Setup credentials
        run: |
          mkdir -p ~/.gem

          cat << EOF > ~/.gem/credentials
          ---
          :github: Bearer ${GITHUB_TOKEN}
          :rubygems_api_key: ${RUBYGEMS_API_KEY}
          EOF

          chmod 0600 ~/.gem/credentials
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
      - name: Release Gem
        run: |
          bundle exec rake release

name: publish-gem

on:
  push:
    tags:
      - v*

jobs:
  publish-gem:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.1'
          bundler-cache: true
      - name: Setup credentials
        run: |
          mkdir -p ~/.gem

          cat << EOF > ~/.gem/credentials
          ---
          :github: Bearer ${GITHUB_TOKEN}
          :rubygems_api_key: ${RUBYGEMS_API_KEY}
          EOF

          chmod 0600 ~/.gem/credentials
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
      - name: Release Gem
        run: |
          bundle exec rake release

Update actions/checkout action to v3
Update actions/checkout action to v3