@@ -3,21 +3,22 @@ name: Publish MCP Registry
33on :
44 workflow_dispatch :
55 workflow_run :
6- workflows : ["Publish PyPI"] # exact name of PyPI workflow
7- types :
8- - completed
6+ workflows : ["Publish PyPI"]
7+ types : [completed]
8+ branches : [main]
99
1010concurrency :
1111 group : publish-${{ github.ref }}
1212 cancel-in-progress : true
1313
1414jobs :
15- registry :
15+ on-success :
1616 name : Publish to MCP Registry
1717 runs-on : ubuntu-latest
18+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
1819 permissions :
1920 contents : read
20- id-token : write # REQUIRED for MCP Registry GitHub OIDC login
21+ id-token : write
2122 steps :
2223 - name : Checkout
2324 uses : actions/checkout@v4
@@ -27,33 +28,21 @@ jobs:
2728 set -e
2829 OS=$(uname -s | tr '[:upper:]' '[:lower:]')
2930 ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
30- echo "Get the latest release version"
3131 LATEST_VERSION=$(curl -s https://api.github.com/repos/modelcontextprotocol/registry/releases/latest | jq -r '.tag_name')
32- echo "Installing MCP Publisher version: $LATEST_VERSION"
33- curl -L "https://github.com/modelcontextprotocol/registry/releases/download/${LATEST_VERSION}/mcp-publisher_${LATEST_VERSION#v}_${OS}_${ARCH}.tar.gz" \
34- | tar xz mcp-publisher
32+ curl -L "https://github.com/modelcontextprotocol/registry/releases/download/${LATEST_VERSION}/mcp-publisher_${LATEST_VERSION#v}_${OS}_${ARCH}.tar.gz" | tar xz mcp-publisher
3533
36- - name : Login to MCP Registry (OIDC)
37- run : |
38- echo "Login to MCP Registry (OIDC)"
39- ./mcp-publisher login github-oidc
34+ - name : Login to MCP Registry
35+ run : ./mcp-publisher login github-oidc
4036
41- - name : Publish server.json to MCP Registry
37+ - name : Publish to MCP Registry
4238 run : |
43- echo "Publish server.json to MCP Registry"
44- # Try to publish, with fallback for duplicate version
45- if ./mcp-publisher publish; then
46- echo "Successfully published to MCP Registry"
47- else
48- PUBLISH_EXIT_CODE=$?
49- echo "Publish failed with exit code: $PUBLISH_EXIT_CODE"
50-
51- # Check if it's a duplicate version error
52- if [ $PUBLISH_EXIT_CODE -ne 0 ]; then
53- echo "Checking if version already exists in registry..."
54-
55- # Get current version from server.json
56- CURRENT_VERSION=$(jq -r '.version' server.json)
57- echo "Current version: $CURRENT_VERSION"
58- fi
59- fi
39+ echo "PyPI workflow succeeded - Publishing to MCP Registry"
40+ ./mcp-publisher publish
41+
42+ on-failure :
43+ name : Handle PyPI Failure
44+ runs-on : ubuntu-latest
45+ if : ${{ github.event.workflow_run.conclusion == 'failure' }}
46+ steps :
47+ - name : Log PyPI Failure
48+ run : echo "PyPI workflow failed - MCP Registry publication skipped"
0 commit comments