This repository was archived by the owner on Jul 8, 2026. It is now read-only.
Publish MCPB Bundle #45
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: Publish MCPB Bundle | |
| on: | |
| push: | |
| branches: main | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (defaults to package.json version)' | |
| required: false | |
| type: string | |
| jobs: | |
| build-mcpb: | |
| name: Build and Publish MCPB Bundle | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TypeScript | |
| run: npm run build | |
| - name: Copy icon to dist | |
| run: | | |
| if [ -f assets/icon.png ]; then | |
| cp assets/icon.png dist/icon.png | |
| fi | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [ -n "${{ github.event.inputs.version }}" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Update manifest version | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| node -e " | |
| const fs = require('fs'); | |
| const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8')); | |
| manifest.version = '$VERSION'; | |
| fs.writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')); | |
| " | |
| - name: Install mcpb CLI | |
| run: npm install -g @anthropic-ai/mcpb | |
| - name: Pack MCPB bundle | |
| run: mcpb pack | |
| - name: Find MCPB file | |
| id: find_mcpb | |
| run: | | |
| MCPB_FILE=$(ls *.mcpb 2>/dev/null | head -1) | |
| echo "file=$MCPB_FILE" >> $GITHUB_OUTPUT | |
| - name: Upload MCPB as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: shortcut-mcp-${{ steps.version.outputs.version }}.mcpb | |
| path: ${{ steps.find_mcpb.outputs.file }} | |
| - name: Upload MCPB to release | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ steps.find_mcpb.outputs.file }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |