1- name : Publish to PyPI
1+ name : " Release: Test, PyPI, MCP "
22
33on :
44 release :
77 workflow_dispatch :
88
99jobs :
10- publish :
10+ test_and_build :
11+ name : Test and Build (pre-release gate)
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+
16+ steps :
17+ - name : Check out code
18+ uses : actions/checkout@v4
19+
20+ - name : Set up Python
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : " 3.12"
24+
25+ - name : Install uv
26+ uses : astral-sh/setup-uv@v5
27+
28+ - name : Install dependencies
29+ run : |
30+ uv sync --all-extras --dev
31+
32+ - name : Run tests
33+ run : |
34+ uv run pytest -q
35+
36+ - name : Build wheel and sdist
37+ run : |
38+ uv build
39+
40+ - name : Validate server.json against schema
41+ run : |
42+ uv run python - <<'PY'
43+ import json, sys, urllib.request
44+ from jsonschema import validate
45+ from jsonschema.exceptions import ValidationError
46+ server = json.load(open('server.json'))
47+ schema_url = server.get('$schema')
48+ with urllib.request.urlopen(schema_url) as r:
49+ schema = json.load(r)
50+ try:
51+ validate(instance=server, schema=schema)
52+ except ValidationError as e:
53+ print('Schema validation failed:', e, file=sys.stderr)
54+ sys.exit(1)
55+ print('server.json is valid')
56+ PY
57+
58+ publish_pypi :
59+ name : Publish to PyPI
60+ needs : test_and_build
1161 runs-on : ubuntu-latest
1262 environment : release
1363 permissions :
3484 - name : Publish to PyPI
3585 uses : pypa/gh-action-pypi-publish@release/v1
3686 with :
37- # Using trusted publishing (no API token needed)
38- # Make sure to configure trusted publishing in PyPI project settings
39- verbose : true
87+ verbose : true
88+
89+ publish_mcp :
90+ name : Publish to MCP Registry
91+ needs : publish_pypi
92+ runs-on : ubuntu-latest
93+ permissions :
94+ id-token : write
95+ contents : read
96+
97+ steps :
98+ - name : Check out code
99+ uses : actions/checkout@v4
100+
101+ - name : Install MCP Publisher
102+ run : |
103+ curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.1.0/mcp-publisher_1.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
104+
105+ - name : Login to MCP Registry (DNS auth)
106+ run : |
107+ # Extract private key using official MCP publisher method
108+ echo "${{ secrets.MCP_PRIVATE_KEY }}" > temp_key.pem
109+ PRIVATE_KEY_HEX=$(openssl pkey -in temp_key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n')
110+ ./mcp-publisher login dns --domain pipeboard.co --private-key "$PRIVATE_KEY_HEX"
111+ rm -f temp_key.pem
112+
113+ - name : Publish to MCP Registry
114+ run : ./mcp-publisher publish
0 commit comments