@@ -101,60 +101,6 @@ jobs:
101101 env :
102102 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
103103
104- - name : Setup Go (for MCP Publisher)
105- if : github.event_name == 'push'
106- uses : actions/setup-go@v5
107- with :
108- go-version : ' 1.22'
109-
110- - name : Install MCP Publisher
111- if : github.event_name == 'push'
112- run : |
113- echo "📥 Fetching MCP Publisher"
114- git clone https://github.com/modelcontextprotocol/registry publisher-repo
115- cd publisher-repo
116- make publisher
117- # The publisher binary is output to bin/mcp-publisher by the Makefile
118- cp bin/mcp-publisher ../mcp-publisher
119- cd ..
120- chmod +x mcp-publisher
121-
122- - name : Login to MCP Registry (DNS)
123- if : github.event_name == 'push'
124- env :
125- MCP_DNS_PRIVATE_KEY : ${{ secrets.MCP_DNS_PRIVATE_KEY }}
126- run : |
127- echo "🔐 Using DNS authentication for com.xcodebuildmcp/* namespace"
128- if [ -z "${MCP_DNS_PRIVATE_KEY}" ]; then
129- echo "❌ Missing secrets.MCP_DNS_PRIVATE_KEY"
130- echo "Add your DNS private key (hex) as a GitHub secret named MCP_DNS_PRIVATE_KEY."
131- echo "Generate/extract with:"
132- echo " openssl genpkey -algorithm Ed25519 -out key.pem"
133- echo " openssl pkey -in key.pem -noout -text | grep -A3 'priv:' | tail -n +2 | tr -d ' :\\n'"
134- exit 1
135- fi
136- ./mcp-publisher login dns --domain xcodebuildmcp.com --private-key "${MCP_DNS_PRIVATE_KEY}"
137-
138- - name : Publish to MCP Registry
139- if : github.event_name == 'push'
140- run : |
141- echo "🚢 Publishing to MCP Registry with retries..."
142- attempts=0
143- max_attempts=5
144- delay=5
145- until ./mcp-publisher publish; do
146- rc=$?
147- attempts=$((attempts+1))
148- if [ $attempts -ge $max_attempts ]; then
149- echo "❌ Publish failed after $attempts attempts (exit $rc)"
150- exit $rc
151- fi
152- echo "⚠️ Publish failed (exit $rc). Retrying in ${delay}s... (attempt ${attempts}/${max_attempts})"
153- sleep $delay
154- delay=$((delay*2))
155- done
156- echo "✅ Publish succeeded."
157-
158104 - name : Create GitHub Release (production releases only)
159105 if : github.event_name == 'push'
160106 uses : softprops/action-gh-release@v1
@@ -198,5 +144,73 @@ jobs:
198144 echo "🎉 Production release completed!"
199145 echo "Version: ${{ steps.get_version.outputs.VERSION }}"
200146 echo "📦 NPM: https://www.npmjs.com/package/xcodebuildmcp/v/${{ steps.get_version.outputs.VERSION }}"
201- echo "📚 MCP Registry: published via mcp-publisher "
147+ echo "📚 MCP Registry: publish attempted in separate job (mcp_registry) "
202148 fi
149+
150+ mcp_registry :
151+ if : github.event_name == 'push'
152+ needs : release
153+ runs-on : ubuntu-latest
154+ env :
155+ MCP_DNS_PRIVATE_KEY : ${{ secrets.MCP_DNS_PRIVATE_KEY }}
156+ steps :
157+ - name : Checkout code
158+ uses : actions/checkout@v4
159+ with :
160+ fetch-depth : 0
161+
162+ - name : Get version from tag
163+ id : get_version_mcp
164+ run : |
165+ VERSION=${GITHUB_REF#refs/tags/v}
166+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
167+ echo "🚢 MCP publish for version: $VERSION"
168+
169+ - name : Missing secret — skip MCP publish
170+ if : env.MCP_DNS_PRIVATE_KEY == ''
171+ run : |
172+ echo "⚠️ Skipping MCP Registry publish: secrets.MCP_DNS_PRIVATE_KEY is not set."
173+ echo "This is optional and does not affect the release."
174+
175+ - name : Setup Go (for MCP Publisher)
176+ if : env.MCP_DNS_PRIVATE_KEY != ''
177+ uses : actions/setup-go@v5
178+ with :
179+ go-version : ' 1.22'
180+
181+ - name : Install MCP Publisher
182+ if : env.MCP_DNS_PRIVATE_KEY != ''
183+ run : |
184+ echo "📥 Fetching MCP Publisher"
185+ git clone https://github.com/modelcontextprotocol/registry publisher-repo
186+ cd publisher-repo
187+ make publisher
188+ cp bin/mcp-publisher ../mcp-publisher
189+ cd ..
190+ chmod +x mcp-publisher
191+
192+ - name : Login to MCP Registry (DNS)
193+ if : env.MCP_DNS_PRIVATE_KEY != ''
194+ run : |
195+ echo "🔐 Using DNS authentication for com.xcodebuildmcp/* namespace"
196+ ./mcp-publisher login dns --domain xcodebuildmcp.com --private-key "${MCP_DNS_PRIVATE_KEY}"
197+
198+ - name : Publish to MCP Registry (best-effort)
199+ if : env.MCP_DNS_PRIVATE_KEY != ''
200+ run : |
201+ echo "🚢 Publishing to MCP Registry with retries..."
202+ attempts=0
203+ max_attempts=5
204+ delay=5
205+ until ./mcp-publisher publish; do
206+ rc=$?
207+ attempts=$((attempts+1))
208+ if [ $attempts -ge $max_attempts ]; then
209+ echo "⚠️ MCP Registry publish failed after $attempts attempts (exit $rc). Skipping without failing workflow."
210+ exit 0
211+ fi
212+ echo "⚠️ Publish failed (exit $rc). Retrying in ${delay}s... (attempt ${attempts}/${max_attempts})"
213+ sleep $delay
214+ delay=$((delay*2))
215+ done
216+ echo "✅ MCP Registry publish succeeded."
0 commit comments