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