diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-01 22:23:00 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-01 22:23:00 +0100 |
| commit | 4887abc5773b33ab1e213ed5f528dfebd242e2cd (patch) | |
| tree | 8eb2316783a21817cce422c3fb58ec953206dd9a /scripts/render-installer.py | |
| parent | v4.3.1: render Windows through wgpu and keep the installer window open (diff) | |
| download | zagan-bet-master.tar.gz zagan-bet-master.zip | |
Adds web/latest.php: a plain-text feed of the newest version with each artifact's filename and SHA-256. The per-release generated installers are replaced by stable web/install.sh and web/install.ps1; both read the feed, pick the newest build, verify it, install per-user and add a launcher. Publishing a new app version no longer regenerates or versions the installers.
publish.sh drops the installer renderer and Python dependency. deploy.sh now also verifies latest.php against the local artifacts and that the served installer scripts match the repository.
Diffstat (limited to 'scripts/render-installer.py')
| -rw-r--r-- | scripts/render-installer.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/scripts/render-installer.py b/scripts/render-installer.py deleted file mode 100644 index 1a00551..0000000 --- a/scripts/render-installer.py +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | """Fill an installer template with one published artifact's details. | ||
| 3 | |||
| 4 | Usage: render-installer.py <template> <output> <version> <binary> <sha256> <url> | ||
| 5 | |||
| 6 | The Linux template embeds the application icon so the installer works offline. | ||
| 7 | """ | ||
| 8 | |||
| 9 | from __future__ import annotations | ||
| 10 | |||
| 11 | import pathlib | ||
| 12 | import sys | ||
| 13 | |||
| 14 | |||
| 15 | def main(argv: list[str]) -> int: | ||
| 16 | if len(argv) != 7: | ||
| 17 | print( | ||
| 18 | "usage: render-installer.py <template> <output> <version> " | ||
| 19 | "<binary> <sha256> <url>", | ||
| 20 | file=sys.stderr, | ||
| 21 | ) | ||
| 22 | return 2 | ||
| 23 | |||
| 24 | template, output, version, binary, sha256, url = argv[1:] | ||
| 25 | root = pathlib.Path(__file__).resolve().parent.parent | ||
| 26 | icon = (root / "gui" / "assets" / "zagan-bet.svg").read_text() | ||
| 27 | |||
| 28 | text = pathlib.Path(template).read_text() | ||
| 29 | replacements = { | ||
| 30 | "__VERSION__": version, | ||
| 31 | "__BINARY__": binary, | ||
| 32 | "__SHA256__": sha256, | ||
| 33 | "__URL__": url, | ||
| 34 | "__ICON__": icon.rstrip("\n"), | ||
| 35 | } | ||
| 36 | for placeholder, value in replacements.items(): | ||
| 37 | text = text.replace(placeholder, value) | ||
| 38 | |||
| 39 | destination = pathlib.Path(output) | ||
| 40 | destination.write_text(text) | ||
| 41 | if destination.suffix == ".sh": | ||
| 42 | destination.chmod(0o755) | ||
| 43 | |||
| 44 | print(f" {destination} ({destination.stat().st_size} bytes)") | ||
| 45 | return 0 | ||
| 46 | |||
| 47 | |||
| 48 | if __name__ == "__main__": | ||
| 49 | raise SystemExit(main(sys.argv)) | ||
