name: Publish to PyPI on: push: tags: - "v*" permissions: contents: read jobs: test: runs-on: ubuntu-22.04 strategy: matrix: python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v4 - name: Install uv and Python ${{ matrix.python-version }} uses: astral-sh/setup-uv@v9 with: version: "0.12.7" python-version: ${{ matrix.python-version }} enable-cache: true - name: Sync dependencies run: uv sync --locked --group dev - name: Run tests run: uv run --no-sync pytest -q - name: Build package run: uv build - name: Check package distribution run: uv run --no-sync twine check dist/* publish: needs: test runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Install uv and Python 3.11 uses: astral-sh/setup-uv@v9 with: version: "0.12.7" python-version: "3.11" enable-cache: true - name: Sync dependencies run: uv sync --locked --group dev - name: Build package run: uv build - name: Check package distribution run: uv run --no-sync twine check dist/* - name: Publish package to PyPI uses: pypa/gh-action-pypa-publish@release/v1 with: password: ${{ secrets.PYPI_TOKEN }}