Build MCP Bundle (MCPB) #2
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 MCP Bundle (MCPB) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Install MCPB CLI | |
| run: npm install -g @anthropic-ai/[email protected] | |
| - name: Create MCPB package | |
| run: | | |
| # Get version from manifest.json | |
| VERSION=$(node -p "require('./manifest.json').version") | |
| echo "Building MCPB for version: $VERSION" | |
| # Create MCPB bundle using mcpb pack | |
| npx @anthropic-ai/[email protected] pack | |
| # Rename to include version | |
| mv microcms-document-mcp-server.mcpb microcms-document-v${VERSION}.mcpb | |
| # Also create a copy without version for consistency | |
| cp microcms-document-v${VERSION}.mcpb microcms-document-mcp-server.mcpb | |
| - name: Verify MCPB creation | |
| run: | | |
| if [ ! -f microcms-document-mcp-server.mcpb ]; then | |
| echo "Error: MCPB file was failed to be created" | |
| exit 1 | |
| fi | |
| ls -la *.mcpb | |
| - name: Upload MCPB as artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: microcms-document-mcpb | |
| path: | | |
| microcms-document-mcp-server.mcpb | |
| microcms-document-v*.mcpb | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download MCPB artifact | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: microcms-document-mcpb | |
| - name: List downloaded files | |
| run: ls -la | |
| - name: Create Release | |
| uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3 | |
| with: | |
| files: | | |
| microcms-document-mcp-server.mcpb | |
| microcms-document-mcp-server-v*.mcpb | |
| generate_release_notes: true | |
| fail_on_unmatched_files: true |