-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (52 loc) · 2.31 KB
/
Copy pathpublish-mcp-registry.yml
File metadata and controls
59 lines (52 loc) · 2.31 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
name: Publish to MCP Registry
# Two ways in:
# 1. workflow_call — the release train (release.yml) invokes this right
# after its npm-publish job, so a tag push now publishes to the MCP
# Registry automatically. The registry validates that the npm package
# at `version` already exists, which is why it's chained *after*
# npm-publish, never racing it.
# 2. workflow_dispatch — kept for manual re-pushes (e.g. re-registering a
# version whose metadata changed) without cutting a new release. Run
# with: gh workflow run publish-mcp-registry.yml -f version=0.2.0
# Either accepts the version with or without a leading `v` (the release
# train passes the raw tag, e.g. `v0.2.0`); the job strips it.
on:
workflow_dispatch:
inputs:
version:
description: 'Version already published to npm as @eilodon/calm-mcp (e.g. 0.2.0)'
required: true
workflow_call:
inputs:
version:
description: 'Tag or version already published to npm (e.g. v0.2.0 or 0.2.0)'
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # required for OIDC auth to the registry
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set version in server.json
env:
VERSION: ${{ inputs.version }}
run: |
VERSION="${VERSION#v}" # accept both `v0.2.0` (release train) and `0.2.0`
jq --arg v "$VERSION" \
'.version = $v | .packages[0].version = $v' \
server.json > server.tmp.json
mv server.tmp.json server.json
- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Authenticate to MCP Registry (GitHub OIDC — this repo's identity, no stored secret)
run: ./mcp-publisher login github-oidc
- name: Publish server.json to the MCP Registry
run: ./mcp-publisher publish
- name: Verify
run: |
sleep 2
curl -fsSL "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.Eilodon/calm-mcp"