File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 11import 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
410data = 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 )
You can’t perform that action at this time.
0 commit comments