diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1ed17ce --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish + +on: + push: + tags: + - "v*" + +jobs: + publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write # Trusted publishing + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + + - name: Set up Python + run: uv python install 3.12 + + - name: Verify tag matches pyproject.toml version + run: | + TAG="${GITHUB_REF#refs/tags/v}" + PKG="$(grep -E '^version = ' pyproject.toml | head -1 | sed -E 's/version = "(.*)"/\1/')" + if [ "$TAG" != "$PKG" ]; then + echo "Tag v$TAG does not match pyproject.toml version $PKG" + exit 1 + fi + + - name: Build distribution + run: uv build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 2e91bd5..c8efaed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "syncthing-blade-mcp" -version = "0.3.1" +version = "0.4.0" description = "MCP server for Syncthing — token-efficient replication management, multi-instance, safe disk-space reclamation." requires-python = ">=3.11" dependencies = [