diff --git a/release/build.py b/release/build.py index 9d6bdf6dad..2a2e69a235 100755 --- a/release/build.py +++ b/release/build.py @@ -89,17 +89,25 @@ def version() -> str: def operating_system() -> str: - match (platform.system(), platform.machine()): - case ("Windows", _): - return "windows" - case ("Linux", _): - return "linux" - case ("Darwin", "x86_64"): - return "macos-x86_64" - case ("Darwin", "arm64"): - return "macos-arm64" - warnings.warn("Unexpected platform.") - return f"{platform.system()}-{platform.machine()}" + match platform.system(): + case "Windows": + system = "windows" + case "Linux": + system = "linux" + case "Darwin": + system = "macos" + case other: + warnings.warn("Unexpected system.") + system = other + match platform.machine(): + case "AMD64" | "x86_64": + machine = "x86_64" + case "arm64": + machine = "arm64" + case other: + warnings.warn("Unexpected platform.") + machine = other + return f"{system}-{machine}" def _pyinstaller(specfile: str) -> None: @@ -350,6 +358,11 @@ def report(block, blocksize, total): installer = DIST_DIR / f"mitmproxy-{version()}-windows-x64-installer.exe" assert installer.exists() + # unify filenames + installer = installer.rename( + installer.with_name(installer.name.replace("x64", "x86_64")) + ) + print("Run installer...") subprocess.run( [installer, "--mode", "unattended", "--unattendedmodeui", "none"], check=True