11name : Publish to MCP Registry
22
33on :
4- push :
5- tags : ["v*" ] # Triggers on version tags like v1.0.0
4+ repository_dispatch :
5+ types : [docker-published ] # Triggered after Docker image is published
66 workflow_dispatch : # Allow manual triggering
77
88jobs :
@@ -23,12 +23,35 @@ jobs:
2323
2424 - name : Fetch tags
2525 run : |
26- if [[ "${{ github.ref_type }}" != "tag" ]]; then
26+ if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
27+ echo "Triggered by docker-published event for tag: ${{ github.event.client_payload.tag }}"
28+ elif [[ "${{ github.ref_type }}" != "tag" ]]; then
2729 git fetch --tags
2830 else
2931 echo "Skipping tag fetch - already on tag ${{ github.ref_name }}"
3032 fi
3133
34+ - name : Wait for Docker image
35+ run : |
36+ if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
37+ TAG="${{ github.event.client_payload.tag }}"
38+ elif [[ "${{ github.ref_type }}" == "tag" ]]; then
39+ TAG="${{ github.ref_name }}"
40+ else
41+ TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
42+ fi
43+ IMAGE="ghcr.io/github/github-mcp-server:$TAG"
44+
45+ for i in {1..6}; do
46+ if docker manifest inspect "$IMAGE" &>/dev/null; then
47+ echo "✅ Docker image ready: $TAG"
48+ break
49+ fi
50+ [ $i -eq 6 ] && { echo "❌ Timeout waiting for $TAG after 3 minutes"; exit 1; }
51+ echo "⏳ Waiting for Docker image ($i/6)..."
52+ sleep 30
53+ done
54+
3255 - name : Install MCP Publisher
3356 run : |
3457 git clone --quiet https://github.com/modelcontextprotocol/registry publisher-repo
3760
3861 - name : Update server.json version
3962 run : |
40- if [[ "${{ github.ref_type }}" == "tag" ]]; then
63+ if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
64+ TAG_VERSION=$(echo "${{ github.event.client_payload.tag }}" | sed 's/^v//')
65+ echo "Using tag from dispatch: ${{ github.event.client_payload.tag }}"
66+ elif [[ "${{ github.ref_type }}" == "tag" ]]; then
4167 TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
4268 else
4369 LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
0 commit comments