Skip to content

Commit ea361db

Browse files
committed
Add MCP registrary publishing to GH release workflow
1 parent a044882 commit ea361db

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,31 @@ jobs:
9696
env:
9797
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9898

99+
- name: Setup Go (for MCP Publisher)
100+
if: github.event_name == 'push'
101+
uses: actions/setup-go@v5
102+
with:
103+
go-version: '1.22'
104+
105+
- name: Install MCP Publisher
106+
if: github.event_name == 'push'
107+
run: |
108+
echo "📥 Fetching MCP Publisher"
109+
git clone https://github.com/modelcontextprotocol/registry publisher-repo
110+
cd publisher-repo
111+
make publisher
112+
cp cmd/publisher/bin/mcp-publisher ../mcp-publisher
113+
cd ..
114+
chmod +x mcp-publisher
115+
116+
- name: Login to MCP Registry (OIDC)
117+
if: github.event_name == 'push'
118+
run: ./mcp-publisher login github-oidc
119+
120+
- name: Publish to MCP Registry
121+
if: github.event_name == 'push'
122+
run: ./mcp-publisher publish
123+
99124
- name: Create GitHub Release (production releases only)
100125
if: github.event_name == 'push'
101126
uses: softprops/action-gh-release@v1
@@ -139,4 +164,5 @@ jobs:
139164
echo "🎉 Production release completed!"
140165
echo "Version: ${{ steps.get_version.outputs.VERSION }}"
141166
echo "📦 NPM: https://www.npmjs.com/package/xcodebuildmcp/v/${{ steps.get_version.outputs.VERSION }}"
142-
fi
167+
echo "📚 MCP Registry: published via mcp-publisher"
168+
fi

scripts/release.sh

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,36 @@ if [[ "$SKIP_VERSION_UPDATE" == "false" ]]; then
275275
echo "📝 Updating version in README.md shield links..."
276276
run "sed -i '' -E 's/npm%3Axcodebuildmcp%40[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+\.[0-9]+)?(-[a-zA-Z0-9]+\.[0-9]+)*(-[a-zA-Z0-9]+)?/npm%3Axcodebuildmcp%40'"$VERSION"'/g' README.md"
277277

278+
# server.json update
279+
echo ""
280+
if [[ -f server.json ]]; then
281+
echo "📝 Updating server.json version to $VERSION..."
282+
run "node -e \"const fs=require('fs');const f='server.json';const j=JSON.parse(fs.readFileSync(f,'utf8'));j.version='$VERSION';if(Array.isArray(j.packages)){j.packages=j.packages.map(p=>({...p,version:'$VERSION'}));}fs.writeFileSync(f,JSON.stringify(j,null,2)+'\n');\""
283+
else
284+
echo "⚠️ server.json not found; skipping update"
285+
fi
286+
278287
# Git operations
279288
echo ""
280289
echo "📦 Committing version changes..."
281-
run "git add package.json README.md"
290+
if [[ -f server.json ]]; then
291+
run "git add package.json README.md server.json"
292+
else
293+
run "git add package.json README.md"
294+
fi
282295
run "git commit -m \"Release v$VERSION\""
283296
else
284297
echo "⏭️ Skipping version update (already done)"
298+
# Ensure server.json still matches the desired version (in case of a partial previous run)
299+
if [[ -f server.json ]]; then
300+
CURRENT_SERVER_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('server.json','utf8')).version||'')")
301+
if [[ "$CURRENT_SERVER_VERSION" != "$VERSION" ]]; then
302+
echo "📝 Aligning server.json to $VERSION..."
303+
run "node -e \"const fs=require('fs');const f='server.json';const j=JSON.parse(fs.readFileSync(f,'utf8'));j.version='$VERSION';if(Array.isArray(j.packages)){j.packages=j.packages.map(p=>({...p,version:'$VERSION'}));}fs.writeFileSync(f,JSON.stringify(j,null,2)+'\\n');\""
304+
run "git add server.json"
305+
run "git commit -m \"Align server.json for v$VERSION\""
306+
fi
307+
fi
285308
fi
286309

287310
# Create or recreate tag at current HEAD
@@ -344,4 +367,4 @@ if [[ -n "$RUN_ID" ]]; then
344367
else
345368
echo "⚠️ Could not find workflow run. Please check manually:"
346369
echo "https://github.com/cameroncooke/XcodeBuildMCP/actions"
347-
fi
370+
fi

0 commit comments

Comments
 (0)