name: Publish to RubyGems.org
on:
  push:
    tags: [ '*' ]
jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.3'
          bundler-cache: true
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - name: Build
        run: bundle exec rake build
      - name: Publish to RubyGems.org
        uses: dawidd6/action-publish-gem@v1
        with:
          api_key: ${{ secrets.RUBYGEMS_API_KEY }}
