Skip to content

Commit

Permalink
updates version
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Dec 17, 2024
1 parent ea15f11 commit e67953f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python3 -m pip install .
python3 -m build
python3 override_version.py
python3 override_version.py ${{ github.event.release.tag_name }}
VERSION=${{ github.event.release.tag_name }}
SDIST_PACKAGE_NAME="schematicpy-${VERSION}.tar.gz"
Expand Down
21 changes: 12 additions & 9 deletions override_version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import toml
import os
import sys

if len(sys.argv) != 2:
print("Usage: python override_version.py VERSION")
sys.exit(1)

RELEASE_VERSION = sys.argv[1]

data = toml.load("pyproject.toml")
#get release version
RELEASE_VERSION = os.getenv('RELEASE_VERSION')
# Modify field
data['tool']['poetry']['version']=RELEASE_VERSION
print('the version number of this release is: ', RELEASE_VERSION)
#override and save changes
f = open("pyproject.toml",'w')
toml.dump(data, f)
f.close()
data["tool"]["poetry"]["version"] = RELEASE_VERSION
print("the version number of this release is: ", RELEASE_VERSION)
# override and save changes
with open("pyproject.toml", "w") as f:
toml.dump(data, f)

0 comments on commit e67953f

Please sign in to comment.