Update release.yml #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 and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | |
| echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Update versions | |
| run: | | |
| # pyproject.toml (simple, line-based) | |
| sed -i -E 's/(version\s*=\s*").*(")/\1${{ steps.version.outputs.version }}\2/' pyproject.toml | |
| # manifest.json (simple, line-based) | |
| sed -i -E 's/("version"\s*:\s*").*(")/\1${{ steps.version.outputs.version }}\2/' manifest.json | |
| - name: Bundle Python deps into server/lib | |
| run: | | |
| mkdir -p server/lib | |
| uv pip install . -t server/lib | |
| - name: Validate manifest (optional but helpful) | |
| run: npx --yes @anthropic-ai/dxt@latest validate manifest.json | |
| - name: Pack DXT | |
| run: | | |
| mkdir -p dist | |
| npx --yes @anthropic-ai/dxt@latest pack . dist/mcp-server-ntm-${{ steps.version.outputs.version }}.dxt | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: Release ${{ steps.version.outputs.tag }} | |
| files: dist/mcp-server-ntm-${{ steps.version.outputs.version }}.dxt | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |