v0.1.6 #9
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
| # This workflow will upload a Python Package to PyPI when a release is created | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Upload Python Package | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/[email protected] | |
| with: | |
| python-version: "3.14" | |
| - name: Update version in pyproject.toml | |
| run: | | |
| # Extract version from release tag (remove 'v' prefix) | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" | |
| # Update version in pyproject.toml | |
| sed -i.bak "s/^version = .*/version = \"$VERSION\"/" pyproject.toml | |
| rm pyproject.toml.bak | |
| echo "Updated pyproject.toml version to: $VERSION" | |
| grep "^version = " pyproject.toml | |
| - name: Build release distributions | |
| run: | | |
| # Build steps | |
| uv build | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| pypi-publish: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - release-build | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| # Dedicated environments with protections for publishing are strongly recommended. | |
| # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules | |
| environment: | |
| name: pypi | |
| # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: | |
| # url: https://pypi.org/p/YOURPROJECT | |
| # | |
| # ALTERNATIVE: if your GitHub Release name is the PyPI project version string | |
| # ALTERNATIVE: exactly, uncomment the following line instead: | |
| # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish release distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: ${{ secrets.PYPI_USERNAME }} | |
| password: ${{ secrets.PYPI_TOKEN }} | |
| packages-dir: dist/ | |
| mcp-publish: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - pypi-publish | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for GitHub OIDC authentication | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Update version in server.json | |
| run: | | |
| # Extract version from release tag (remove 'v' prefix) | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" | |
| # Update version in server.json using jq | |
| jq --arg version "$VERSION" '.version = $version' server.json > server.json.tmp | |
| mv server.json.tmp server.json | |
| echo "Updated server.json version to: $VERSION" | |
| cat server.json | jq '.version' | |
| - name: Install MCP Publisher | |
| run: | | |
| # Download and install pre-built binary for Linux | |
| 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 | |
| sudo mv mcp-publisher /usr/local/bin/ | |
| mcp-publisher --version | |
| - name: Authenticate with GitHub OIDC | |
| run: | | |
| # GitHub Actions OIDC authentication (no secrets needed) | |
| mcp-publisher login github-oidc | |
| - name: Publish to MCP Registry | |
| run: | | |
| mcp-publisher publish |