Publish to MCP Registry #11
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 to MCP Registry | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build project | |
| run: npm run build | |
| - name: Validate server.json | |
| run: npm run validate:server | |
| - name: Run tests | |
| run: | | |
| # Skip tests if no test command is configured properly | |
| npm run test || true | |
| - name: Install MCP Publisher | |
| run: | | |
| curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher | |
| sudo mv mcp-publisher /usr/local/bin/ | |
| mcp-publisher --version | |
| - name: Login to MCP Registry (GitHub OIDC) | |
| run: mcp-publisher login github-oidc | |
| - name: Publish to MCP Registry | |
| run: mcp-publisher publish |