feat:解决第一次编译,报错,找不到release路径的问题 (#342)

* 解决第一次编译,报错,找不到release路径的问题

* Update release.py

---------

Co-authored-by: guoxianwei <xianwei.guo@orioniot.cn>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
This commit is contained in:
bruceOrange22
2025-03-14 11:12:59 +08:00
committed by GitHub
parent a1d150a0b4
commit 4a7ef0b995

View File

@@ -31,10 +31,12 @@ def merge_bin():
sys.exit(1)
def zip_bin(board_type, project_version):
if not os.path.exists("releases"):
os.makedirs("releases")
output_path = f"releases/v{project_version}_{board_type}.zip"
if os.path.exists(output_path):
os.remove(output_path)
with zipfile.ZipFile(output_path, 'w') as zipf:
with zipfile.ZipFile(output_path, 'w', compression=zipfile.ZIP_DEFLATED) as zipf:
zipf.write("build/merged-binary.bin", arcname="merged-binary.bin")
print(f"zip bin to {output_path} done")