Skip to content

Commit 283d150

Browse files
fix: use dynamic versioning (#15)
1 parent 5857890 commit 283d150

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.releaserc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
"plugins": [
55
"@semantic-release/commit-analyzer",
66
"@semantic-release/release-notes-generator",
7-
["@semantic-release/exec", {
8-
"prepareCmd": "if [ -f pyproject.toml ]; then python3 -c \"import re; content = open('pyproject.toml').read(); content = re.sub(r'(version\\s*=\\s*)[\\\"\\'][^\\\"\\']+([\\\"\\'\\)])', r'\\\\1\\\"${nextRelease.version}\\\"\\\\2', content); open('pyproject.toml', 'w').write(content); print('Updated pyproject.toml version to ${nextRelease.version}')\"; else echo 'No pyproject.toml found, skipping Python version update'; fi",
9-
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
10-
}],
7+
"@semantic-release/github",
118
["@semantic-release/git", {
12-
"assets": ["pyproject.toml"],
13-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
9+
"assets": "false"
1410
}],
15-
"@semantic-release/github"
11+
["@semantic-release/exec", {
12+
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}]
1614
]
1715
}

pyproject.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[build-system]
2-
requires = ["hatchling"]
2+
requires = ["hatchling", "hatch-vcs"]
33
build-backend = "hatchling.build"
44

55
[project]
66
name = "tim-mcp"
7-
version = "1.2.0"
7+
# Version is managed dynamically via git tags using hatch-vcs
8+
# Do not add a static version field here as it will conflict with dynamic versioning
9+
dynamic = ["version"]
810
description = "Terraform IBM Modules MCP"
911
readme = "README.md"
1012
requires-python = ">=3.11"
@@ -79,3 +81,9 @@ packages = ["tim_mcp"]
7981

8082
[tool.hatch.build.targets.wheel.force-include]
8183
"static" = "tim_mcp/static"
84+
85+
[tool.hatch.version]
86+
source = "vcs"
87+
88+
[tool.hatch.build.hooks.vcs]
89+
version-file = "tim_mcp/_version.py"

0 commit comments

Comments
 (0)