From 4887abc5773b33ab1e213ed5f528dfebd242e2cd Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 22:23:00 +0100 Subject: v4.4.0: stable installers that follow the newest published build 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. --- scripts/publish.sh | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'scripts/publish.sh') diff --git a/scripts/publish.sh b/scripts/publish.sh index 3a04631..fbcd588 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -5,20 +5,19 @@ # zagan-bet-client---[.exe] # zagan-bet-server---[.exe] # zagan-bet-gui---[.exe] -# zagan-bet-gui----install.sh -# zagan-bet-gui----install.ps1 # # Cargo always writes target///, so the rename happens # here after each build. The version comes from Cargo.toml. # # The GUI uses the workspace's `gui-release` profile (small, stripped, LTO). -# The public git repository is the GPL source for these binaries, so publish -# from a clean tree (or set ALLOW_DIRTY=1 for a preview). +# The installers are stable site files (web/install.sh and web/install.ps1): +# they ask web/latest.php for the newest build, so they are not regenerated +# here. The public git repository is the GPL source for these binaries, so +# publish from a clean tree (or set ALLOW_DIRTY=1 for a preview). # # Usage: # ./scripts/publish.sh # DEST=/srv/www/bin ./scripts/publish.sh -# URL_BASE=https://staging.example/ ./scripts/publish.sh set -euo pipefail ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) @@ -31,22 +30,12 @@ if [ -z "${VERSION:-}" ]; then fi DEST=${DEST:-web/bin} -URL_BASE=${URL_BASE:-https://zagan.2137697.xyz} if [ "${ALLOW_DIRTY:-0}" != "1" ] && [ -n "$(git status --porcelain)" ]; then echo "the working tree is dirty; commit the release first (or ALLOW_DIRTY=1)" >&2 exit 1 fi -command -v python3 >/dev/null || { - echo "python3 is required to render the installers" >&2 - exit 1 -} - -hash_of() { - sha256sum "$1" | awk '{print $1}' -} - publish() { local triple=$1 kind=$2 platform=$3 arch=$4 local ext="" @@ -85,23 +74,13 @@ publish_gui() { mkdir -p "$DEST/gui" install -m 0755 "$source" "$DEST/gui/$artifact" - local sha - sha=$(hash_of "$DEST/gui/$artifact") echo " $DEST/gui/$artifact ($(du -h "$DEST/gui/$artifact" | cut -f1))" - - if [ "$platform" = linux ]; then - python3 scripts/render-installer.py \ - scripts/installers/linux.sh.in \ - "$DEST/gui/zagan-bet-gui-$VERSION-linux-$arch-install.sh" \ - "$VERSION" "$artifact" "$sha" "$URL_BASE/bin/gui/$artifact" - elif [ "$platform" = windows ]; then - python3 scripts/render-installer.py \ - scripts/installers/windows.ps1.in \ - "$DEST/gui/zagan-bet-gui-$VERSION-windows-$arch-install.ps1" \ - "$VERSION" "$artifact" "$sha" "$URL_BASE/bin/gui/$artifact" - fi } +rm web/bin/client/* +rm web/bin/gui/* +rm web/bin/server/* + publish_gui x86_64-unknown-linux-gnu linux x86_64 publish_gui x86_64-pc-windows-gnu windows x86_64 -- cgit v1.2.3