1111def zip_directory (data ):
1212 dirToZip , version = data
1313 source_dir = f"packages/{ dirToZip } "
14- result_dir = f"temp/{ source_dir } /v { version } "
14+ result_dir = f"temp/{ source_dir } /legacy- { dirToZip } "
1515 print (f"Starting to copy files from { source_dir } to { result_dir } ..." )
1616 shutil .copytree (source_dir , result_dir , dirs_exist_ok = True )
1717 print (f"Files copied successfully to { result_dir } ." )
1818 archive_name = f"{ os .path .dirname (result_dir )} /{ dirToZip } .7z"
1919 print (f"Starting to create archive { archive_name } ..." )
2020 with py7zr .SevenZipFile (archive_name , mode = 'w' ) as z :
21- z .writeall (result_dir , f"v { version } " )
21+ z .writeall (result_dir , f"legacy- { dirToZip } " )
2222 print (f"Archive { archive_name } created successfully." )
2323 return archive_name
2424
@@ -46,7 +46,7 @@ async def upload_release_asset(session, token, repo, tag_name, asset_path):
4646
4747async def main (token , repo , tag_name ):
4848 print ("Number of CPU cores available:" , os .cpu_count ())
49-
49+
5050 dirs_to_process = os .listdir ("./packages" )
5151 print (f"Found directories: { dirs_to_process } " )
5252 zip_data = [prepare_zip_data (dir ) for dir in dirs_to_process ]
@@ -70,7 +70,7 @@ async def main(token, repo, tag_name):
7070 parser .add_argument ("repo" , help = "Repository name, e.g., 'username/repo'" )
7171 parser .add_argument ("tag_name" , help = "Tag name from the release" )
7272 args = parser .parse_args ()
73-
73+
7474 print ("Starting the upload process..." )
7575 asyncio .run (main (args .token , args .repo , args .tag_name ))
7676 print ("Upload process completed." )
0 commit comments