feat: add GitHub workflow for publishing packages to MCP Registry

This commit is contained in:
enesgules 2025-10-23 00:28:59 +03:00
parent 04e8dc8ede
commit 02402b42ad

52
.github/workflows/publish-mcp.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Publish to MCP Registry
on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (defaults to package.json version)'
required: false
type: string
jobs:
publish-mcp:
name: Publish to MCP Registry
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication with MCP Registry
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Set version
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION=$(node -p "require('./package.json').version")
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION"
- name: Update package version in server.json
run: |
echo $(jq --arg v "${{ env.VERSION }}" '(.packages[0].version) = $v' server.json) > server.json
- name: Validate server.json
run: npx mcp-registry-validator validate server.json
- name: Install MCP Publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.3.3/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Login to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish