name: Publish to PyPI

on:
  push:
    tags:
      - 'v*'

jobs:
  release:
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v6
        with:
          version: "0.7.19"
          python-version: "3.11"

      - name: Build wheel
        run: uv build

      - name: Publish package
        run: uv publish