Workflow file for this run
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
| name: Publish to PyPI and MCP Registry | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| attestations: write | |
| jobs: | |
| build: | |
| name: Build distributions | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| outputs: | |
| artifact-name: python-package-distributions | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade build twine pkginfo | |
| - name: Build distributions | |
| run: python -m build | |
| - name: Check distributions | |
| run: python -m twine check dist/* | |
| - name: Verify wheel install | |
| run: | | |
| python -m pip install dist/*.whl | |
| commit-check-mcp --help | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-package-distributions | |
| path: dist/* | |
| - name: Create attestations | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: dist/* | |
| publish: | |
| name: Publish to PyPI | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| environment: pypi | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: python-package-distributions | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| publish-mcp-registry: | |
| name: Publish server.json to MCP Registry | |
| needs: publish | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC authentication with MCP Registry | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v7 | |
| - name: Extract version from release tag | |
| id: version | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| if [ -z "$TAG" ]; then | |
| TAG="$(git describe --tags --abbrev=0)" | |
| fi | |
| VERSION="${TAG#v}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Set version in server.json | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| echo "Setting server.json version to $VERSION" | |
| jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.json.tmp | |
| mv server.json.tmp server.json | |
| echo "=== Updated server.json ===" | |
| cat server.json | |
| - name: Install mcp-publisher | |
| run: | | |
| curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher | |
| - name: Authenticate to MCP Registry (OIDC) | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish server to MCP Registry | |
| run: ./mcp-publisher publish |