summaryrefslogtreecommitdiffstats
path: root/web/latest.php
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-01 22:23:00 +0100
committersalmonik <salmonik@tuta.io>2026-11-01 22:23:00 +0100
commit4887abc5773b33ab1e213ed5f528dfebd242e2cd (patch)
tree8eb2316783a21817cce422c3fb58ec953206dd9a /web/latest.php
parentv4.3.1: render Windows through wgpu and keep the installer window open (diff)
downloadzagan-bet-master.tar.gz
zagan-bet-master.zip
v4.4.0: stable installers that follow the newest published buildHEADmaster
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.php50
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
2declare(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
20require __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';
30foreach ($all as $release) {
31 if (version_compare($release['version'], $newest, '>')) {
32 $newest = $release['version'];
33 }
34}
35
36header('Content-Type: text/plain; charset=utf-8');
37header('Cache-Control: no-cache');
38
39echo 'version ' . $newest . "\n";
40foreach ($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}