name: Publish PyPI on: workflow_dispatch: concurrency: group: publish-pypi-${{ github.ref }} cancel-in-progress: true jobs: pypi: name: Publish PyPI runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read id-token: write steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - name: Install uv run: pipx install uv - name: Sync dependencies run: uv sync --extra dev - name: Run ruff lint run: uvx ruff check . - name: Run ruff format check run: uvx ruff format --check . - name: Run tests run: | if [ -d tests ]; then uv run pytest -q -m "not slow and not integration" || [ $? -eq 5 ] # exit 5 = no tests collected else echo "No tests/ directory; skipping." fi - name: Build package run: uv build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist