Skip to content

Commit e67953f

Browse files
committed
updates version
1 parent ea15f11 commit e67953f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
python3 -m pip install .
2626
python3 -m build
2727
28-
python3 override_version.py
28+
python3 override_version.py ${{ github.event.release.tag_name }}
2929
3030
VERSION=${{ github.event.release.tag_name }}
3131
SDIST_PACKAGE_NAME="schematicpy-${VERSION}.tar.gz"

override_version.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import toml
2-
import os
2+
import sys
3+
4+
if len(sys.argv) != 2:
5+
print("Usage: python override_version.py VERSION")
6+
sys.exit(1)
7+
8+
RELEASE_VERSION = sys.argv[1]
39

410
data = toml.load("pyproject.toml")
5-
#get release version
6-
RELEASE_VERSION = os.getenv('RELEASE_VERSION')
711
# Modify field
8-
data['tool']['poetry']['version']=RELEASE_VERSION
9-
print('the version number of this release is: ', RELEASE_VERSION)
10-
#override and save changes
11-
f = open("pyproject.toml",'w')
12-
toml.dump(data, f)
13-
f.close()
12+
data["tool"]["poetry"]["version"] = RELEASE_VERSION
13+
print("the version number of this release is: ", RELEASE_VERSION)
14+
# override and save changes
15+
with open("pyproject.toml", "w") as f:
16+
toml.dump(data, f)

0 commit comments

Comments
 (0)