Name checksum files distinctively as SHA256SUMS-windows.txt and SHA256SUMS-linux.txt

This commit is contained in:
2026-09-03 22:13:36 +02:00
parent e634b060df
commit 4e2242e0ae
+7 -18
View File
@@ -51,11 +51,12 @@ def build_linux_zipapp_binary():
) )
print(f"[+] Successfully generated {bin_output}") print(f"[+] Successfully generated {bin_output}")
def generate_checksums(): def generate_checksums(os_type="windows"):
checksum_file = os.path.join(DIST_DIR, "SHA256SUMS.txt") checksum_filename = f"SHA256SUMS-{os_type}.txt"
checksum_file = os.path.join(DIST_DIR, checksum_filename)
lines = [] lines = []
for fname in sorted(os.listdir(DIST_DIR)): for fname in sorted(os.listdir(DIST_DIR)):
if fname == "SHA256SUMS.txt": if fname.startswith("SHA256SUMS"):
continue continue
fpath = os.path.join(DIST_DIR, fname) fpath = os.path.join(DIST_DIR, fname)
if os.path.isfile(fpath): if os.path.isfile(fpath):
@@ -64,6 +65,7 @@ def generate_checksums():
lines.append(f"{digest} {fname}") lines.append(f"{digest} {fname}")
with open(checksum_file, "w", encoding="utf-8") as f: with open(checksum_file, "w", encoding="utf-8") as f:
f.write("\n".join(lines) + "\n") f.write("\n".join(lines) + "\n")
print(f"[+] Generated checksums file: {checksum_filename}")
def main(): def main():
print("=" * 60) print("=" * 60)
@@ -84,8 +86,7 @@ def main():
server_script = os.path.join(OUT_DIR, "server", "Server.py") server_script = os.path.join(OUT_DIR, "server", "Server.py")
build_pyinstaller_binary(server_script, "Server") build_pyinstaller_binary(server_script, "Server")
# Build Linux client standalone binary generate_checksums("windows")
build_linux_zipapp_binary()
else: else:
# On Linux runner: Build native Linux binaries # On Linux runner: Build native Linux binaries
linux_client_script = os.path.join(OUT_DIR, "linux_client", "Linux_Client.py") linux_client_script = os.path.join(OUT_DIR, "linux_client", "Linux_Client.py")
@@ -94,19 +95,7 @@ def main():
server_script = os.path.join(OUT_DIR, "server", "Server.py") server_script = os.path.join(OUT_DIR, "server", "Server.py")
build_pyinstaller_binary(server_script, "Server.bin") build_pyinstaller_binary(server_script, "Server.bin")
# Also package standalone Windows zipapp executable generate_checksums("linux")
win_app_dir = os.path.join(BUILD_TEMP, "win_app")
os.makedirs(win_app_dir, exist_ok=True)
shutil.copy(os.path.join(OUT_DIR, "win_client", "Win_Client.py"), os.path.join(win_app_dir, "Win_Client.py"))
win_bin_output = os.path.join(DIST_DIR, "Win_Client.pyz")
zipapp.create_archive(
source=win_app_dir,
target=win_bin_output,
interpreter="/usr/bin/env python3",
main="Win_Client:main"
)
generate_checksums()
# Clean temporary build directory # Clean temporary build directory
if os.path.exists(BUILD_TEMP): if os.path.exists(BUILD_TEMP):