1+ name : Build Desktop Extension (DXT)
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : write
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : Setup Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : ' 22'
24+
25+ - name : Install dependencies
26+ run : npm ci
27+
28+ - name : Build project
29+ run : npm run build
30+
31+ - name : Install DXT CLI globally
32+ run : npm install -g @anthropic-ai/dxt
33+
34+ - name : Create DXT package
35+ run : |
36+ # Get version from manifest.json
37+ VERSION=$(node -p "require('./manifest.json').version")
38+ echo "Building DXT for version: $VERSION"
39+
40+ # Create DXT directly in project root (dxt pack includes dependencies)
41+ npx @anthropic-ai/dxt pack
42+
43+ # Rename to include version
44+ mv microcms-mcp-server.dxt microcms-mcp-server-v${VERSION}.dxt
45+
46+ # Also create a copy without version for consistency
47+ cp microcms-mcp-server-v${VERSION}.dxt microcms-mcp-server.dxt
48+
49+ - name : Verify DXT creation
50+ run : |
51+ if [ ! -f microcms-mcp-server.dxt ]; then
52+ echo "Error: DXT file was failed to be created"
53+ exit 1
54+ fi
55+ ls -la *.dxt
56+
57+ - name : Upload DXT as artifact
58+ uses : actions/upload-artifact@v4
59+ with :
60+ name : microcms-mcp-server-dxt
61+ path : |
62+ microcms-mcp-server.dxt
63+ microcms-mcp-server-v*.dxt
64+
65+ release :
66+ needs : build
67+ runs-on : ubuntu-latest
68+ if : startsWith(github.ref, 'refs/tags/')
69+
70+ steps :
71+ - name : Download DXT artifact
72+ uses : actions/download-artifact@v4
73+ with :
74+ name : microcms-mcp-server-dxt
75+
76+ - name : List downloaded files
77+ run : ls -la
78+
79+ - name : Create Release
80+ uses : softprops/action-gh-release@v2
81+ with :
82+ files : |
83+ microcms-mcp-server.dxt
84+ microcms-mcp-server-v*.dxt
85+ generate_release_notes : true
86+ fail_on_unmatched_files : true
0 commit comments