@@ -10,59 +10,58 @@ jobs:
1010 runs-on : ubuntu-latest
1111 permissions :
1212 contents : write
13-
13+
1414 steps :
15- - name : Checkout code
16- uses : actions/checkout@v4
17-
15+ - uses : actions/checkout@v4
16+
1817 - name : Extract version from tag
1918 id : version
2019 run : |
21- VERSION=${GITHUB_REF#refs/tags/v}
22- echo "version=$VERSION" >> $GITHUB_OUTPUT
23- echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
24-
20+ echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
21+ echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
22+
2523 - name : Set up Python
2624 uses : actions/setup-python@v5
2725 with :
2826 python-version : ' 3.12'
29-
27+
3028 - name : Set up Node.js
3129 uses : actions/setup-node@v4
3230 with :
3331 node-version : ' 20'
34-
32+ cache : ' npm'
33+
3534 - name : Install uv
3635 uses : astral-sh/setup-uv@v4
3736 with :
3837 version : " latest"
39-
40- - name : Update version in pyproject.toml
38+
39+ - name : Update versions
4140 run : |
42- sed -i 's/version = ".*"/version = "${{ steps.version.outputs.version }}"/' pyproject.toml
43-
44- - name : Update version in manifest.json
41+ # pyproject.toml (simple, line-based)
42+ sed -i -E 's/(version\s*=\s*").*(")/\1${{ steps.version.outputs.version }}\2/' pyproject.toml
43+ # manifest.json (simple, line-based)
44+ sed -i -E 's/("version"\s*:\s*").*(")/\1${{ steps.version.outputs.version }}\2/' manifest.json
45+
46+ - name : Bundle Python deps into server/lib
4547 run : |
46- sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.version }}"/' manifest.json
47-
48- - name : Build project
48+ mkdir -p server/lib
49+ uv pip install . -t server/lib
50+
51+ - name : Validate manifest (optional but helpful)
52+ run : npx --yes @anthropic-ai/dxt@latest validate manifest.json
53+
54+ - name : Pack DXT
4955 run : |
50- # Bundle dependencies
51- uv sync
52- uv pip install . --target ./lib/
53-
54- # Install npm dependencies
55- npm install @anthropic-ai/dxt
56-
57- # Build DXT extension
58- npx dxt pack
59-
56+ mkdir -p dist
57+ npx --yes @anthropic-ai/dxt@latest pack . dist/mcp-server-ntm-${{ steps.version.outputs.version }}.dxt
58+
6059 - name : Create Release
6160 uses : softprops/action-gh-release@v2
6261 with :
6362 tag_name : ${{ steps.version.outputs.tag }}
6463 name : Release ${{ steps.version.outputs.tag }}
65- files : mcp-server-ntm.dxt
64+ files : dist/ mcp-server-ntm-${{ steps.version.outputs.version }} .dxt
6665 generate_release_notes : true
6766 env :
68- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments