Htmx migration #10586
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Build-only workflow - runs `make dist` to create sdist & wheel, no lint/tests | |
| # Docs: https://docs.github.com/en/actions | PyPA build: https://pypi.org/project/build | |
| name: Build Python Package | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - "mcpgateway/**" | |
| - "pyproject.toml" | |
| - "Makefile" | |
| - "MANIFEST.in" | |
| - ".github/workflows/python-package.yml" | |
| pull_request: | |
| types: [opened, synchronize, ready_for_review] | |
| branches: [ "main" ] | |
| paths: | |
| - "mcpgateway/**" | |
| - "pyproject.toml" | |
| - "Makefile" | |
| - "MANIFEST.in" | |
| - ".github/workflows/python-package.yml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-package: | |
| if: github.event_name != 'pull_request' || !github.event.pull_request.draft | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| # Build the package under multiple Python versions to catch ABI issues early | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] # Extend as needed | |
| steps: | |
| # 1️⃣ Check out repository so Makefile & sources are available | |
| - name: Checkout code | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| persist-credentials: false | |
| # 2️⃣ Set up the requested Python version from the runner tool-cache | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # 3️⃣ Install build front-end; Keep pip current; bootstrap venv | |
| - name: Install build tool | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install build uv==0.11.1 # PyPA builder + pinned uv for make venv | |
| - name: Bootstrap project venv | |
| run: make venv | |
| # 4️⃣ Invoke the Makefile 'dist' target (creates ./dist/*.whl & *.tar.gz) | |
| - name: Build distributions | |
| run: make dist # Uses the Makefile's `dist` rule | |
| # 5️⃣ Install package quality tools | |
| - name: Install package linters | |
| run: | | |
| python3 -m pip install twine check-manifest pyroma | |
| # 6️⃣ Validate wheel/sdist metadata | |
| - name: Check distribution metadata (twine) | |
| run: twine check dist/* | |
| # 7️⃣ Verify MANIFEST.in completeness | |
| - name: Check manifest (check-manifest) | |
| run: check-manifest | |
| # 8️⃣ Assess package quality | |
| - name: Check package quality (pyroma) | |
| run: pyroma -d . | |
| # 9️⃣ Upload built artifacts so they can be downloaded from the run page | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: python-package-${{ matrix.python-version }} | |
| path: dist/* |