name: Publish

on:
  release:
    types: [published]

jobs:
  build:
    name: Publish to Rubygems
    runs-on: ubuntu-latest

    permissions:
      contents: write
      id-token: write

    steps:
      - uses: actions/checkout@v6

      - name: Setup Ruby 3.x
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
          ruby-version: 3

      - name: Publish to RubyGems
        uses: rubygems/release-gem@v1
