11import os
2+ import subprocess
3+ import sys
24from pathlib import Path
3- from subprocess import run
5+ from typing import Any
46
57from scripts .tools import get_version
68
79
10+ def run (title : str , * args : Any , ** kwargs : Any ) -> None :
11+ try :
12+ print (f"running { title } " )
13+ subprocess .run (* args , ** kwargs )
14+ except (SystemExit , KeyboardInterrupt ):
15+ raise
16+ except BaseException as e :
17+ print (f"{ title } failed: { e } " , file = sys .stderr )
18+ pass
19+
20+
821def main () -> None :
922 dist_path = Path ("./dist" )
1023
@@ -15,14 +28,10 @@ def main() -> None:
1528
1629 vsix_path = Path (dist_path , f"robotcode-{ current_version } .vsix" )
1730
18- print ("publish to vscode marketplace..." )
19- run (f"npx vsce publish -i { vsix_path } " , shell = True , timeout = 600 )
20-
21- print ("publish to openVSX..." )
22- run (f"npx ovsx publish { vsix_path } " , shell = True , timeout = 600 )
23-
24- print ("publish to PyPi..." )
31+ run ("npx vsce publish" , f"npx vsce publish -i { vsix_path } " , shell = True , timeout = 600 )
32+ run ("npx ovsx publish" , f"npx ovsx publish { vsix_path } " , shell = True , timeout = 600 )
2533 run (
34+ "poetry publish" ,
2635 f"poetry publish --username { os .environ ['PYPI_USERNAME' ]} --password { os .environ ['PYPI_PASSWORD' ]} " ,
2736 shell = True ,
2837 timeout = 600 ,
0 commit comments