@@ -59,13 +59,8 @@ def main(generate_input, generate_output):
5959 package ["version" ] = last_version
6060
6161 _LOGGER .info (f"[PACKAGE]({ package_name } )[CHANGELOG]:{ md_output } " )
62- # Built package
63- create_package (prefolder , package_name )
64- folder_name = package ["path" ][0 ]
65- dist_path = Path (sdk_folder , folder_name , package_name , "dist" )
66- package ["artifacts" ] = [str (dist_path / package_file ) for package_file in os .listdir (dist_path )]
67- package ["result" ] = "succeeded"
6862 # Generate api stub File
63+ folder_name = package ["path" ][0 ]
6964 try :
7065 package_path = Path (sdk_folder , folder_name , package_name )
7166 check_call (
@@ -87,22 +82,31 @@ def main(generate_input, generate_output):
8782 package ["apiViewArtifact" ] = str (Path (package_path , file ))
8883 except Exception as e :
8984 _LOGGER .debug (f"Fail to generate ApiView token file for { package_name } : { e } " )
85+
86+ # check generated files and update package["version"]
87+ if package_name .startswith ("azure-mgmt-" ):
88+ try :
89+ check_file (package )
90+ except Exception as e :
91+ _LOGGER .error (f"Fail to check generated files for { package_name } : { e } " )
92+
93+ # Built package
94+ create_package (prefolder , package_name )
95+ dist_path = Path (sdk_folder , folder_name , package_name , "dist" )
96+ package ["artifacts" ] = [str (dist_path / package_file ) for package_file in os .listdir (dist_path )]
97+ for artifact in package ["artifacts" ]:
98+ if ".whl" in artifact :
99+ package ["language" ] = "Python"
100+ break
90101 # Installation package
91102 package ["installInstructions" ] = {
92103 "full" : "You can install the use using pip install of the artifacts." ,
93104 "lite" : f"pip install { package_name } " ,
94105 }
95- for artifact in package ["artifacts" ]:
96- if ".whl" in artifact :
97- package ["language" ] = "Python"
98- break
106+ package ["result" ] = "succeeded"
99107 package ["packageFolder" ] = package ["path" ][0 ]
100108 result ["packages" ].append (package )
101109
102- # check generated files
103- if package_name .startswith ("azure-mgmt-" ):
104- check_file (package )
105-
106110 with open (generate_output , "w" ) as writer :
107111 json .dump (result , writer )
108112
0 commit comments