File tree Expand file tree Collapse file tree 1 file changed +27
-23
lines changed
Expand file tree Collapse file tree 1 file changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -82,26 +82,30 @@ def fail_and_revert(msg):
8282 exit (1 )
8383
8484
85- # sync with remote no matter what
86- if subprocess .run (["git" , "push" ]).returncode != 0 :
87- fail_and_revert ("Failed to push" )
88-
89- # 1. build the package via uv
90- print ("uv build" )
91- if subprocess .run (["uv" , "build" ]).returncode != 0 :
92- fail_and_revert ("Failed to build the package" )
93-
94- # 2. create a new release
95- print (f"gh release create { new_v } dist/*" )
96- if (
97- subprocess .run (
98- [
99- "gh" ,
100- "release" ,
101- "create" ,
102- "v" + new_v ,
103- ]
104- ).returncode
105- != 0
106- ):
107- fail_and_revert ("Failed to create release" )
85+ try :
86+ # sync with remote no matter what
87+ if subprocess .run (["git" , "push" ]).returncode != 0 :
88+ fail_and_revert ("Failed to push" )
89+
90+ # 1. build the package via uv
91+ print ("uv build" )
92+ if subprocess .run (["uv" , "build" ]).returncode != 0 :
93+ fail_and_revert ("Failed to build the package" )
94+
95+ # 2. create a new release
96+ print (f"gh release create { new_v } dist/*" )
97+ if (
98+ subprocess .run (
99+ [
100+ "gh" ,
101+ "release" ,
102+ "create" ,
103+ "v" + new_v ,
104+ ]
105+ ).returncode
106+ != 0
107+ ):
108+ fail_and_revert ("Failed to create release" )
109+
110+ except Exception as e :
111+ fail_and_revert (str (e ))
You can’t perform that action at this time.
0 commit comments