Publish MCP Registry #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish MCP Registry | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22.14.0" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Type-check | |
| run: npm run check | |
| - name: Build package | |
| run: npm run build | |
| - name: Sync server.json version from package.json | |
| shell: bash | |
| run: | | |
| VERSION="$(node -p "require('./package.json').version")" | |
| node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('server.json','utf8')); pkg.version='${VERSION}'; pkg.packages=pkg.packages.map(p => ({...p, version:'${VERSION}'})); fs.writeFileSync('server.json', JSON.stringify(pkg, null, 2) + '\n');" | |
| - name: Publish package to npm | |
| run: npm publish | |
| - name: Install mcp-publisher | |
| shell: bash | |
| 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 | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish server to MCP Registry | |
| run: ./mcp-publisher publish |