name: CI on: push: branches: [ main ] tags: - 'v*.*.*' pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e '.[dev]' - name: Lint with ruff run: ruff check . - name: Check formatting with black run: black --check . - name: Run tests run: pytest - name: Build package run: python -m build - name: Check package run: twine check dist/* deploy: name: Publish Python 🐍 distribution 📦 to PyPI needs: build runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install build tools run: | python -m pip install --upgrade pip pip install build twine - name: Build package run: python -m build - name: Publish to PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: twine upload dist/*