Skip to content

Commit 4a21594

Browse files
committed
publish released versions to the MCP registry
The Registry workflow runs after a successful Release, so the OCI image the entry references already exists when the registry validates its ownership label; a manual dispatch covers tags released before the workflow existed. server.json is stamped with the released version at publish time -- the checked-in file keeps the 0.0.0 placeholder. Domain ownership is proved over DNS: the workflow signs with the Ed25519 key from the mcp-registry environment, admitted from main only. workflow_run executes the default branch's workflow file, so a pull-request branch can neither alter the job nor reach the secret. Refs: #22
1 parent c0f1ec0 commit 4a21594

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/registry.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Registry
2+
3+
on:
4+
workflow_run:
5+
workflows: [Release]
6+
types: [completed]
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Released tag to publish (e.g. v1.1.0)"
11+
required: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
publish:
18+
# Publishes the released version to the MCP registry. It runs after the
19+
# Release workflow so the OCI image the entry references already exists
20+
# when the registry validates it; the manual dispatch covers tags
21+
# released before this workflow existed. The signing key lives in the
22+
# mcp-registry environment, admitted from main only — and workflow_run
23+
# always executes the default branch's workflow file, so a PR branch can
24+
# neither alter this job nor reach the secret.
25+
if: >-
26+
github.repository == 'GaijinEntertainment/go-gerrit-mcp' &&
27+
(github.event_name == 'workflow_dispatch' ||
28+
(github.event.workflow_run.conclusion == 'success' &&
29+
startsWith(github.event.workflow_run.head_branch, 'v')))
30+
runs-on: ubuntu-latest
31+
environment: mcp-registry
32+
env:
33+
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.workflow_run.head_branch }}
34+
steps:
35+
- uses: actions/checkout@v7
36+
with:
37+
ref: ${{ env.TAG }}
38+
- name: Stamp server.json with the released version
39+
run: |
40+
version="${TAG#v}"
41+
jq --arg v "$version" '
42+
.version = $v
43+
| .packages[0].identifier = "ghcr.io/gaijinentertainment/go-gerrit-mcp:" + $v
44+
' server.json > server.json.stamped
45+
mv server.json.stamped server.json
46+
- name: Install mcp-publisher
47+
# Unpinned on purpose: the publisher tracks the live registry API,
48+
# and an old pinned binary is likelier to break than a fresh one.
49+
run: |
50+
curl -fsSL https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz \
51+
| tar xz mcp-publisher
52+
- name: Publish to the MCP registry
53+
env:
54+
MCP_PRIVATE_KEY: ${{ secrets.MCP_PRIVATE_KEY }}
55+
run: |
56+
./mcp-publisher login dns --domain=gaijin.team --private-key="$MCP_PRIVATE_KEY"
57+
./mcp-publisher publish

0 commit comments

Comments
 (0)