name: Publish to PyPI

on:
  push:
    tags:
      - "v*"

permissions:
  contents: read   # Required for actions/checkout
  id-token: write  # Required for OIDC Trusted Publisher

jobs:
  publish:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    environment: pypi
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v4

      - name: Build package
        run: uv build

      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
