From 041a9d447188aec62dbb99100996aec7f67523d2 Mon Sep 17 00:00:00 2001 From: JakeBreath Date: Sun, 20 Sep 2026 21:11:19 -0500 Subject: [PATCH] Keep desktop builds and the feed to one version Both scripts now read the version from desktop/package.json: the build report and checksums only cover the current version's artifacts, the feed copy ignores older files, and publishing prunes previous installers from the feed (latest*.yml only ever points at the current one). --- deploy/build_desktop.sh | 6 +++--- deploy/push_desktop.sh | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/deploy/build_desktop.sh b/deploy/build_desktop.sh index ebb9f65..2381067 100755 --- a/deploy/build_desktop.sh +++ b/deploy/build_desktop.sh @@ -41,9 +41,9 @@ esac VERSION="$(node -p "require('./desktop/package.json').version")" case "$TARGET" in - linux) ARTIFACTS=(-name "*.deb" -o -name "*.pkg.tar.zst") ;; - win) ARTIFACTS=(-name "*.exe") ;; - all) ARTIFACTS=(-name "*.deb" -o -name "*.pkg.tar.zst" -o -name "*.exe") ;; + linux) ARTIFACTS=(-name "*${VERSION}*.deb" -o -name "*${VERSION}*.pkg.tar.zst") ;; + win) ARTIFACTS=(-name "*${VERSION}*.exe") ;; + all) ARTIFACTS=(-name "*${VERSION}*.deb" -o -name "*${VERSION}*.pkg.tar.zst" -o -name "*${VERSION}*.exe") ;; esac echo diff --git a/deploy/push_desktop.sh b/deploy/push_desktop.sh index 55443c9..9dc45df 100755 --- a/deploy/push_desktop.sh +++ b/deploy/push_desktop.sh @@ -54,20 +54,29 @@ FEED=deploy/data/desktop mkdir -p "$FEED" shopt -s nullglob -deb=(desktop/release/*.deb) -zst=(desktop/release/*.pkg.tar.zst) +VERSION="$(node -p "require('./desktop/package.json').version")" +deb=(desktop/release/*"$VERSION"*.deb) +zst=(desktop/release/*"$VERSION"*.pkg.tar.zst) linux_meta=(desktop/release/latest-linux.yml) -win_exe=("desktop/release/J621 Setup "*.exe) +win_exe=("desktop/release/J621 Setup ${VERSION}"*.exe) win_meta=(desktop/release/latest.yml) -blockmaps=(desktop/release/*.blockmap) +blockmaps=(desktop/release/*"$VERSION"*.exe.blockmap) if [ "${#deb[@]}" -eq 0 ] && [ "${#zst[@]}" -eq 0 ]; then - echo "No artifacts in desktop/release/ — run without --no-build first." >&2 + echo "No $VERSION artifacts in desktop/release/ — run without --no-build first." >&2 exit 1 fi -# Replace the previous release's metadata before copying the new artifacts. +# Replace the previous release's metadata and drop older installers from the +# feed: latest*.yml only ever points at the current version. rm -f "$FEED"/latest-linux.yml "$FEED"/latest.yml +old=("$FEED"/*.deb "$FEED"/*.pkg.tar.zst "$FEED"/"J621 Setup "*.exe "$FEED"/*.exe.blockmap) +for file in "${old[@]}"; do + case "$(basename "$file")" in + *"$VERSION"*) ;; + *) echo " pruning $(basename "$file")"; rm -f "$file" ;; + esac +done cp -f "${deb[@]}" "${zst[@]}" "${linux_meta[@]}" "$FEED"/ 2>/dev/null || true if [ "${#win_exe[@]}" -gt 0 ]; then cp -f "${win_exe[@]}" "${win_meta[@]}" "${blockmaps[@]}" "$FEED"/ 2>/dev/null || true