-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.49 KB
/
Copy pathpublish-registry.yml
File metadata and controls
84 lines (73 loc) · 2.49 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Publish MCP Registry Metadata
on:
workflow_dispatch:
inputs:
version:
description: "Registry version to publish, for example 0.1.0"
required: true
type: string
push:
tags:
- "vector-db-v*"
permissions:
contents: read
id-token: write
packages: read
jobs:
publish-registry:
runs-on: ubuntu-latest
defaults:
run:
working-directory: projects/vector-db
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Resolve release version
id: version
shell: bash
run: |
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF_NAME#vector-db-v}"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Wait for OCI image
shell: bash
run: |
IMAGE="ghcr.io/kroq86/vector-db-mcp:${{ steps.version.outputs.version }}"
for attempt in {1..30}; do
if docker manifest inspect "$IMAGE" > /dev/null 2>&1; then
echo "Found $IMAGE"
exit 0
fi
echo "Waiting for $IMAGE to become available ($attempt/30)"
sleep 10
done
echo "Timed out waiting for $IMAGE" >&2
exit 1
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- 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: Set release version in server.json
shell: bash
run: |
VERSION="${{ steps.version.outputs.version }}"
jq --arg version "$VERSION" \
--arg identifier "ghcr.io/kroq86/vector-db-mcp:${VERSION}" \
'.version = $version | .packages[0].identifier = $identifier' \
server.json > server.json.tmp
mv server.json.tmp server.json
cat server.json
- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish server metadata
run: ./mcp-publisher publish