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