Skip to content

Commit 232ac3f

Browse files
committed
fix: read version from pyproject.toml in build job, avoid importing package
1 parent f83ccd0 commit 232ac3f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ jobs:
5353
- name: Verify tag matches package version
5454
run: |
5555
TAG="${GITHUB_REF_NAME#v}"
56-
VERSION=$(python -c "import logtide_sdk; print(logtide_sdk.__version__)")
56+
VERSION=$(python -c "
57+
import re, pathlib
58+
content = pathlib.Path('pyproject.toml').read_text()
59+
print(re.search(r'^version\s*=\s*\"(.+?)\"', content, re.MULTILINE).group(1))
60+
")
61+
echo "Tag: $TAG | Package version: $VERSION"
5762
if [ "$TAG" != "$VERSION" ]; then
5863
echo "ERROR: tag '$TAG' does not match package version '$VERSION'"
5964
exit 1

0 commit comments

Comments
 (0)