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/deploy.sh | |
| parent | v4.3.1: render Windows through wgpu and keep the installer window open (diff) | |
| download | zagan-bet-4887abc5773b33ab1e213ed5f528dfebd242e2cd.tar.gz zagan-bet-4887abc5773b33ab1e213ed5f528dfebd242e2cd.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 '')
| -rwxr-xr-x | scripts/deploy.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh index b18d462..63bd31c 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh | |||
| @@ -95,6 +95,20 @@ origin=$(printf '%s' "$URL" | sed -E 's#^(https?://[^/]+).*#\1#') | |||
| 95 | grep -oE '[0-9a-f]{64} [A-Za-z0-9._-]+' "$tmp/page.html" > "$tmp/sums" || true | 95 | grep -oE '[0-9a-f]{64} [A-Za-z0-9._-]+' "$tmp/page.html" > "$tmp/sums" || true |
| 96 | [ -s "$tmp/sums" ] || die "no SHA-256 lines on the page (is index.php being served?)" | 96 | [ -s "$tmp/sums" ] || die "no SHA-256 lines on the page (is index.php being served?)" |
| 97 | 97 | ||
| 98 | for script in install.sh install.ps1; do | ||
| 99 | grep -qE "href=\"[^\"]*/$script\"" "$tmp/page.html" \ | ||
| 100 | || die "$script is not linked from the page" | ||
| 101 | curl -fsSL --max-time 30 "$origin/$script" -o "$tmp/$script" \ | ||
| 102 | || die "could not fetch $script" | ||
| 103 | cmp -s "web/$script" "$tmp/$script" \ | ||
| 104 | || die "$script served from the site differs from the local file" | ||
| 105 | done | ||
| 106 | |||
| 107 | curl -fsSL --max-time 30 "$origin/latest.php" -o "$tmp/latest.txt" \ | ||
| 108 | || die "could not fetch latest.php" | ||
| 109 | newest=$(awk '$1 == "version" { print $2; exit }' "$tmp/latest.txt") | ||
| 110 | [ -n "$newest" ] || die "latest.php has no version line" | ||
| 111 | |||
| 98 | failed=0 | 112 | failed=0 |
| 99 | verified=0 | 113 | verified=0 |
| 100 | for local in "${artifacts[@]}"; do | 114 | for local in "${artifacts[@]}"; do |
| @@ -132,6 +146,16 @@ for local in "${artifacts[@]}"; do | |||
| 132 | continue | 146 | continue |
| 133 | fi | 147 | fi |
| 134 | 148 | ||
| 149 | version=$(printf '%s' "$file" | sed -E 's/^zagan-bet-[a-z]+-([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/') | ||
| 150 | if [ "$version" = "$newest" ]; then | ||
| 151 | latest_hash=$(awk -v kind="$kind" -v name="$file" '$1 == kind && $5 == name { print $6 }' "$tmp/latest.txt") | ||
| 152 | if [ "$latest_hash" != "$local_hash" ]; then | ||
| 153 | echo " $file: latest.php shows ${latest_hash:-nothing}, local is $local_hash" | ||
| 154 | failed=1 | ||
| 155 | continue | ||
| 156 | fi | ||
| 157 | fi | ||
| 158 | |||
| 135 | echo " $file: ok" | 159 | echo " $file: ok" |
| 136 | verified=$((verified + 1)) | 160 | verified=$((verified + 1)) |
| 137 | done | 161 | done |
