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 /web/latest.php | |
| 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 '')
| -rw-r--r-- | web/latest.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/web/latest.php b/web/latest.php new file mode 100644 index 0000000..3e7368c --- /dev/null +++ b/web/latest.php | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | <?php | ||
| 2 | declare(strict_types=1); | ||
| 3 | |||
| 4 | /** | ||
| 5 | * The newest published build, for install.sh and install.ps1. | ||
| 6 | * | ||
| 7 | * Plain text, one record per line, so both a shell script and PowerShell can | ||
| 8 | * parse it without a JSON library: | ||
| 9 | * | ||
| 10 | * version 4.4.0 | ||
| 11 | * gui linux x86_64 4.4.0 zagan-bet-gui-4.4.0-linux-x86_64 <sha256> | ||
| 12 | * gui windows x86_64 4.4.0 zagan-bet-gui-4.4.0-windows-x86_64.exe <sha256> | ||
| 13 | * client ... | ||
| 14 | * server ... | ||
| 15 | * | ||
| 16 | * Only the newest version is listed. The installers verify the SHA-256 they | ||
| 17 | * read here against the bytes they download. | ||
| 18 | */ | ||
| 19 | |||
| 20 | require __DIR__ . '/releases.php'; | ||
| 21 | |||
| 22 | $scan = scan_releases(); | ||
| 23 | $all = array_merge( | ||
| 24 | $scan['releases']['gui'], | ||
| 25 | $scan['releases']['client'], | ||
| 26 | $scan['releases']['server'] | ||
| 27 | ); | ||
| 28 | |||
| 29 | $newest = '0.0.0'; | ||
| 30 | foreach ($all as $release) { | ||
| 31 | if (version_compare($release['version'], $newest, '>')) { | ||
| 32 | $newest = $release['version']; | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 36 | header('Content-Type: text/plain; charset=utf-8'); | ||
| 37 | header('Cache-Control: no-cache'); | ||
| 38 | |||
| 39 | echo 'version ' . $newest . "\n"; | ||
| 40 | foreach ($all as $release) { | ||
| 41 | if ($release['version'] !== $newest) { | ||
| 42 | continue; | ||
| 43 | } | ||
| 44 | echo $release['kind'] . ' ' | ||
| 45 | . $release['platform'] . ' ' | ||
| 46 | . $release['arch'] . ' ' | ||
| 47 | . $release['version'] . ' ' | ||
| 48 | . $release['file'] . ' ' | ||
| 49 | . $release['sha256'] . "\n"; | ||
| 50 | } | ||
