feat: mcp register #236
Workflow file for this run
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: build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC authentication | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Run Continuous Integration | |
| run: | | |
| npm install | |
| npm run build | |
| npx vitest --watch=false | |
| - name: Build | |
| run: npm run build | |
| # ---- 下面这段原来在 publish job,直接搬过来 ---- | |
| - name: Update server.json version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| sed -i "s/{{VERSION}}/$VERSION/g" server.json | |
| - 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 | |
| - name: Login & Publish to MCP Registry | |
| run: | | |
| ./mcp-publisher login github-oidc | |
| ./mcp-publisher publish |