Repository navigation
ci: publish MCP server to official registry #8
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build EasyEDA extension | |
| run: npm run build | |
| - name: Check and build MCP | |
| run: npm run check --workspace=mcp | |
| - name: Pack MCP | |
| run: | | |
| mkdir artifacts | |
| npm pack --workspace=mcp --pack-destination artifacts | |
| cp build/dist/*.eext artifacts/ | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: easyeda-copilot-${{ github.sha }} | |
| path: artifacts/* | |
| retention-days: 14 | |
| - name: Publish MCP package to npm | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: npm publish --workspace=mcp --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install MCP Registry publisher | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher | |
| - name: Publish to Official MCP Registry | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| working-directory: mcp | |
| run: | | |
| ../mcp-publisher login github-oidc | |
| ../mcp-publisher publish | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| files: artifacts/* |