diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index f9d0de3..2b4e472 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -47,6 +47,18 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" semantic-release version semantic-release publish + + - name: Sync version to config.py + run: | + pip install toml + python scripts/sync_version.py + if git diff --quiet config.py; then + echo "No version changes in config.py" + else + git add config.py + git commit -m "chore: sync version to config.py [skip ci]" + git push + fi - name: Upload build artifacts to release if: hashFiles('dist/*') != '' diff --git a/config.py b/config.py index aa6725e..dc1af36 100644 --- a/config.py +++ b/config.py @@ -14,9 +14,9 @@ import os # These values are used in server responses and for tracking releases # IMPORTANT: This is the single source of truth for version and author info # Semantic versioning: MAJOR.MINOR.PATCH -__version__ = "5.8.5" +__version__ = "5.8.6" # Last update date in ISO format -__updated__ = "2025-08-08" +__updated__ = "2025-08-20" # Primary maintainer __author__ = "Fahad Gilani" diff --git a/pyproject.toml b/pyproject.toml index e0fada4..3ec44c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "zen-mcp-server" -version = "1.0.0" +version = "5.8.6" description = "AI-powered MCP server with multiple model providers" requires-python = ">=3.9" dependencies = [ diff --git a/scripts/sync_version.py b/scripts/sync_version.py new file mode 100755 index 0000000..d2e33fd --- /dev/null +++ b/scripts/sync_version.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +""" +Sync version from pyproject.toml to config.py +This script is called by GitHub Actions after semantic-release updates the version +""" + +import re +from datetime import datetime +import toml + + +def update_config_version(): + # Read version from pyproject.toml + with open("pyproject.toml", "r") as f: + data = toml.load(f) + version = data["project"]["version"] + + # Read current config.py + with open("config.py", "r") as f: + content = f.read() + + # Update version + content = re.sub( + r'__version__ = "[^"]*"', + f'__version__ = "{version}"', + content + ) + + # Update date to current date + today = datetime.now().strftime("%Y-%m-%d") + content = re.sub( + r'__updated__ = "[^"]*"', + f'__updated__ = "{today}"', + content + ) + + # Write back + with open("config.py", "w") as f: + f.write(content) + + print(f"Updated config.py to version {version}") + + +if __name__ == "__main__": + update_config_version() \ No newline at end of file