Skip to content

Commit e44bca1

Browse files
authored
Merge pull request #38 from TikHub/v2.1.0
fix: read version from file instead of importing module in release wo…
2 parents 7836e41 + 4978060 commit e44bca1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919
- name: Verify version matches tag
2020
run: |
2121
TAG="${GITHUB_REF#refs/tags/v}"
22-
PKG_VERSION=$(python -c "from src.tikhub._version import __version__; print(__version__)")
22+
PKG_VERSION=$(python -c "
23+
import re, pathlib
24+
text = pathlib.Path('src/tikhub/_version.py').read_text()
25+
print(re.search(r'__version__\s*=\s*[\"'\''](.*?)[\"'\'']', text).group(1))
26+
")
2327
if [ "$TAG" != "$PKG_VERSION" ]; then
2428
echo "::error::tag $TAG does not match package version $PKG_VERSION"
2529
exit 1

0 commit comments

Comments
 (0)