feat: Add SHA256 checksum generation to Windows build script
- Automatically generate checksum file after building exe - Checksum saved as WebDropBridge.exe.sha256 - Required for package uploads - Also increase upload timeout to 600s for large files
This commit is contained in:
parent
847692eef6
commit
9c8a8d269c
2 changed files with 25 additions and 1 deletions
|
|
@ -91,8 +91,30 @@ class WindowsBuilder:
|
||||||
print(f"📦 Output: {exe_path}")
|
print(f"📦 Output: {exe_path}")
|
||||||
print(f" Size: {exe_path.stat().st_size / 1024 / 1024:.1f} MB")
|
print(f" Size: {exe_path.stat().st_size / 1024 / 1024:.1f} MB")
|
||||||
|
|
||||||
|
# Generate SHA256 checksum
|
||||||
|
self.generate_checksum(exe_path)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def generate_checksum(self, file_path: Path) -> None:
|
||||||
|
"""Generate SHA256 checksum for file."""
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
print("\n📝 Generating SHA256 checksum...")
|
||||||
|
sha256_hash = hashlib.sha256()
|
||||||
|
|
||||||
|
with open(file_path, "rb") as f:
|
||||||
|
for byte_block in iter(lambda: f.read(4096), b""):
|
||||||
|
sha256_hash.update(byte_block)
|
||||||
|
|
||||||
|
checksum = sha256_hash.hexdigest()
|
||||||
|
checksum_file = file_path.parent / f"{file_path.name}.sha256"
|
||||||
|
|
||||||
|
checksum_file.write_text(checksum)
|
||||||
|
print(f"✅ Checksum generated")
|
||||||
|
print(f" File: {checksum_file}")
|
||||||
|
print(f" Hash: {checksum}")
|
||||||
|
|
||||||
def create_msi(self) -> bool:
|
def create_msi(self) -> bool:
|
||||||
"""Create MSI installer using WiX Toolset.
|
"""Create MSI installer using WiX Toolset.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,9 @@ try {
|
||||||
-Method PUT `
|
-Method PUT `
|
||||||
-Headers $headers `
|
-Headers $headers `
|
||||||
-InFile $ExePath `
|
-InFile $ExePath `
|
||||||
-ContentType "application/octet-stream"
|
-ContentType "application/octet-stream" `
|
||||||
|
-TimeoutSec 600 `
|
||||||
|
-ErrorAction Stop
|
||||||
|
|
||||||
Write-Host "[OK] Executable uploaded successfully" -ForegroundColor Green
|
Write-Host "[OK] Executable uploaded successfully" -ForegroundColor Green
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue