fix filenames, test final Windows installer (#5691)

This commit is contained in:
Maximilian Hils 2022-10-29 17:11:54 +02:00 committed by GitHub
parent 34b0600ef8
commit f3f9df9b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@
3. The spawned workflow runs will require manual confirmation on GitHub which you need to approve twice:
https://github.com/mitmproxy/mitmproxy/actions
4. Once everything has been deployed, update the website.
5. Verify that the front-page download links for all platforms are working.
### GitHub Releases

View File

@ -78,9 +78,9 @@ class ZipFile2(zipfile.ZipFile):
def archive(path: Path) -> tarfile.TarFile | ZipFile2:
if platform.system() == "Windows":
return ZipFile2(path.with_suffix(".zip"), "w")
return ZipFile2(path.with_name(f"{path.name}.zip"), "w")
else:
return tarfile.open(path.with_suffix(".tar.gz"), "w:gz")
return tarfile.open(path.with_name(f"{path.name}.tar.gz"), "w:gz")
def version() -> str:
@ -251,7 +251,16 @@ def installbuilder_installer():
)
installer = DIST_DIR / f"mitmproxy-{version()}-windows-x64-installer.exe"
assert installer.exists()
assert installer.stat().st_size > 10 * 1024 * 1024 # sanity check that files are included: we expect at least 10mb.
print("Run installer...")
subprocess.run(
[installer, "--mode", "unattended", "--unattendedmodeui", "none"], check=True
)
MITMPROXY_INSTALL_DIR = Path(rf"C:\Program Files\mitmproxy\bin")
for tool in ["mitmproxy", "mitmdump", "mitmweb"]:
executable = (MITMPROXY_INSTALL_DIR / tool).with_suffix(".exe")
print(f"> {executable} --version")
subprocess.check_call([executable, "--version"])
if __name__ == "__main__":