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).
This commit is contained in:
2026-09-20 21:11:19 -05:00
parent d84fdd0e98
commit 041a9d4471
2 changed files with 18 additions and 9 deletions
+15 -6
View File
@@ -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