@@ -16,33 +16,67 @@ jobs:
1616 - name : Checkout code
1717 uses : actions/checkout@v5
1818
19+ - name : Setup Go
20+ uses : actions/setup-go@v6
21+ with :
22+ go-version : " stable"
23+
1924 - name : Fetch tags
20- run : git fetch --tags
25+ run : |
26+ if [[ "${{ github.ref_type }}" != "tag" ]]; then
27+ git fetch --tags
28+ else
29+ echo "Skipping tag fetch - already on tag ${{ github.ref_name }}"
30+ fi
31+
32+ - name : Wait for Docker image
33+ run : |
34+ if [[ "${{ github.ref_type }}" == "tag" ]]; then
35+ TAG="${{ github.ref_name }}"
36+ else
37+ TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
38+ fi
39+ IMAGE="ghcr.io/github/github-mcp-server:$TAG"
40+
41+ for i in {1..10}; do
42+ if docker manifest inspect "$IMAGE" &>/dev/null; then
43+ echo "✅ Docker image ready: $TAG"
44+ break
45+ fi
46+ [ $i -eq 10 ] && { echo "❌ Timeout waiting for $TAG after 5 minutes"; exit 1; }
47+ echo "⏳ Waiting for Docker image ($i/10)..."
48+ sleep 30
49+ done
2150
2251 - name : Install MCP Publisher
2352 run : |
24- curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
53+ git clone --quiet https://github.com/modelcontextprotocol/registry publisher-repo
54+ cd publisher-repo && make publisher > /dev/null && cd ..
55+ cp publisher-repo/bin/mcp-publisher . && chmod +x mcp-publisher
2556
2657 - name : Update server.json version
2758 run : |
2859 if [[ "${{ github.ref_type }}" == "tag" ]]; then
29- # Use the tag that triggered the workflow
3060 TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
31- echo "Using triggered tag: ${{ github.ref_name }}"
3261 else
33- # Fallback to latest tag (for manual triggers)
3462 LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
35- if [ -z "$LATEST_TAG" ]; then
36- echo "❌ No release tag found. Cannot determine version."
37- exit 1
38- fi
63+ [ -z "$LATEST_TAG" ] && { echo "No release tag found"; exit 1; }
3964 TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
4065 echo "Using latest tag: $LATEST_TAG"
4166 fi
4267 sed -i "s/\${VERSION}/$TAG_VERSION/g" server.json
43- echo "Updated server.json version to $TAG_VERSION"
68+ echo "Version: $TAG_VERSION"
69+
70+ - name : Validate configuration
71+ run : |
72+ python3 -m json.tool server.json > /dev/null && echo "Configuration valid" || exit 1
73+
74+ - name : Display final server.json
75+ run : |
76+ echo "Final server.json contents:"
77+ cat server.json
4478
45- - name : Login to MCP Registry
79+ - name : Login to MCP Registry (OIDC)
4680 run : ./mcp-publisher login github-oidc
4781
4882 - name : Publish to MCP Registry
0 commit comments