name: 🚀 Deploy to PyPI

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: ubuntu-24.04

    steps:
    - uses: actions/checkout@v4
    - name: Set up Python 3.12
      uses: actions/setup-python@v5
      with:
        python-version: 3.12
    - name: Install build dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build wheel
    - name: Build package
      run: |
        python -m build
    - name: Publish a Python distribution to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1
      with:
        password: ${{ secrets.pypi_password }}
