Skip to content

Commit 1269df2

Browse files
author
mcp-release-bot
committed
fix(release): clean workflow file to resolve parsing issues
1 parent a3a67d5 commit 1269df2

File tree

1 file changed

+36
-47
lines changed

1 file changed

+36
-47
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
workflow_dispatch:
8-
inputs:
9-
tag:
10-
description: 'Tag to release (e.g., v0.3.5)'
11-
required: true
12-
type: string
137

148
env:
159
PYTHON_VERSION: "3.13"
@@ -45,7 +39,7 @@ jobs:
4539
- name: Clean dist directory
4640
run: rm -rf dist/
4741
- name: Build package
48-
run: uv build --no-sources
42+
run: uv build
4943
- name: Upload dist artifacts
5044
uses: actions/upload-artifact@v4
5145
with:
@@ -120,26 +114,18 @@ jobs:
120114
with:
121115
fetch-depth: 0
122116
- name: Generate changelog
123-
id: changelog
124117
run: |
125-
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
126-
echo "## Changes in ${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
127-
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD >> $GITHUB_OUTPUT || echo "- Initial release" >> $GITHUB_OUTPUT
128-
echo "" >> $GITHUB_OUTPUT
129-
echo "EOF" >> $GITHUB_OUTPUT
118+
echo "## What's Changed" > CHANGELOG.md
119+
echo "" >> CHANGELOG.md
120+
git log --oneline --pretty=format:"* %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD >> CHANGELOG.md || echo "* Initial release" >> CHANGELOG.md
130121
- uses: actions/download-artifact@v4
131122
with:
132123
name: dist
133124
path: dist
134125
- uses: softprops/action-gh-release@v2
135126
with:
136-
tag_name: ${{ github.ref_name }}
137-
name: Release ${{ github.ref_name }}
138-
body: ${{ steps.changelog.outputs.CHANGELOG }}
139-
draft: false
140-
prerelease: false
141-
files: |
142-
dist/*
127+
files: dist/*
128+
body_path: CHANGELOG.md
143129
generate_release_notes: true
144130

145131
publish_mcp_registry:
@@ -167,34 +153,38 @@ jobs:
167153
import json, tomllib, os
168154
VERSION = os.environ['VERSION']
169155
with open('pyproject.toml','rb') as f:
170-
proj = tomllib.load(f)['project']
171-
desc = (proj.get('description','') or '')[:100] # MCP Registry requires <= 100 chars
172-
data = {
173-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
174-
"name": "io.github.OtherVibes/mcp-as-a-judge",
175-
"description": desc,
176-
"version": VERSION,
177-
"transports": [
178-
{"type": "stdio"}
179-
],
180-
"packages": [
181-
{"registry_type": "pypi", "identifier": "mcp-as-a-judge", "version": VERSION, "transport": {"type": "stdio"}}
182-
]
156+
data = tomllib.load(f)
157+
project = data['project']
158+
server = {
159+
"name": project['name'],
160+
"description": project['description'],
161+
"version": VERSION,
162+
"homepage": next((url['Homepage'] for url in project.get('urls', {}).items() if url[0] == 'Homepage'), ''),
163+
"license": project.get('license', {}).get('text', 'MIT'),
164+
"runtime": {
165+
"type": "uv",
166+
"package": f"{project['name']}=={VERSION}",
167+
"transport": {"type": "stdio"}
168+
}
183169
}
184-
with open('server.json','w') as f: json.dump(data,f,indent=2)
170+
with open('server.json', 'w') as f:
171+
json.dump(server, f, indent=2)
185172
PY
186173
- name: Login to MCP Registry (GitHub OIDC)
187-
run: ./mcp-publisher login github-oidc
174+
run: |
175+
./mcp-publisher auth login --provider github
188176
- name: Publish to MCP Registry
189-
run: ./mcp-publisher publish
177+
env:
178+
NAME: ${{ fromJSON(steps.server.outputs.json).name }}
179+
run: |
180+
./mcp-publisher publish server.json
190181
- name: Verify publication
191182
env:
192-
NAME: io.github.OtherVibes/mcp-as-a-judge
183+
NAME: ${{ fromJSON(steps.server.outputs.json).name }}
193184
run: |
194-
for i in {1..10}; do
195-
sleep 3
196-
curl -sf "https://registry.modelcontextprotocol.io/v0/servers?search=$NAME" -o out.json || true
197-
python - <<'PY'
185+
sleep 10
186+
./mcp-publisher search "$NAME" > out.json
187+
python - <<'PY'
198188
import json, sys, os
199189
name = os.environ['NAME']
200190
try:
@@ -206,10 +196,9 @@ jobs:
206196
items = data.get('results') or data.get('servers') or data.get('data') or []
207197
elif isinstance(data, list):
208198
items = data
209-
ok = any(isinstance(s, dict) and s.get('name') == name for s in items)
210-
sys.exit(0 if ok else 1)
199+
found = any(item.get('name') == name for item in items)
200+
if not found:
201+
print(f"Package {name} not found in registry")
202+
sys.exit(1)
203+
print(f"✅ Package {name} successfully published to MCP Registry")
211204
PY
212-
if [ $? -eq 0 ]; then echo "Verified $NAME in registry"; exit 0; fi
213-
done
214-
echo "Server not visible in registry yet"
215-
exit 1

0 commit comments

Comments
 (0)