fix: update MCP Dockerfile to use pnpm monorepo setup and update sche… #57
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: Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC authentication with MCP Registry | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Configure npm authentication | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Create Release PR or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm release | |
| commit: "chore(release): version packages" | |
| title: "chore(release): version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Check if MCP was published | |
| id: check-mcp | |
| if: steps.changesets.outputs.published == 'true' | |
| run: | | |
| PUBLISHED='${{ steps.changesets.outputs.publishedPackages }}' | |
| if echo "$PUBLISHED" | jq -e '.[] | select(.name == "@upstash/context7-mcp")' > /dev/null; then | |
| VERSION=$(echo "$PUBLISHED" | jq -r '.[] | select(.name == "@upstash/context7-mcp") | .version') | |
| echo "mcp_published=true" >> $GITHUB_OUTPUT | |
| echo "mcp_version=$VERSION" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Update version in MCP source file | |
| if: steps.check-mcp.outputs.mcp_published == 'true' | |
| run: | | |
| VERSION="${{ steps.check-mcp.outputs.mcp_version }}" | |
| sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"$VERSION\"/" packages/mcp/src/index.ts | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add packages/mcp/src/index.ts | |
| git commit -m "chore: update MCP version in source to $VERSION" || true | |
| git push || true | |
| - name: Update server.json | |
| if: steps.check-mcp.outputs.mcp_published == 'true' | |
| run: | | |
| VERSION="${{ steps.check-mcp.outputs.mcp_version }}" | |
| echo $(jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json) > server.json | |
| git add server.json | |
| git commit -m "chore: update server.json to v$VERSION" || true | |
| git push || true | |
| - name: Publish to MCP Registry | |
| if: steps.check-mcp.outputs.mcp_published == 'true' | |
| 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 | |
| ./mcp-publisher login github-oidc | |
| ./mcp-publisher publish |