Prune old desktop builds from release/ on every build
build_desktop.sh now reads the version first and removes anything in desktop/release/ that is not that version (plus the regenerated unpacked trees), so a version bump never leaves old installers lying around — the same rule push_desktop.sh applies to the feed.
This commit is contained in:
+15
-2
@@ -22,6 +22,8 @@ case "$TARGET" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
VERSION="$(node -p "require('./desktop/package.json').version")"
|
||||||
|
|
||||||
if [ ! -d desktop/node_modules ]; then
|
if [ ! -d desktop/node_modules ]; then
|
||||||
echo "==> Installing desktop dependencies ..."
|
echo "==> Installing desktop dependencies ..."
|
||||||
npm --prefix desktop ci --no-audit --no-fund
|
npm --prefix desktop ci --no-audit --no-fund
|
||||||
@@ -32,14 +34,25 @@ if [ "$TARGET" != "linux" ] && ! command -v wine >/dev/null 2>&1; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# release/ should only ever hold the current version: old installers are
|
||||||
|
# rebuilt from git when needed, and the unpacked trees are regenerated.
|
||||||
|
shopt -s nullglob
|
||||||
|
stale=(desktop/release/*.deb desktop/release/*.pkg.tar.zst desktop/release/"J621 Setup "*.exe
|
||||||
|
desktop/release/*.blockmap desktop/release/latest*.yml)
|
||||||
|
for file in "${stale[@]}"; do
|
||||||
|
case "$(basename "$file")" in
|
||||||
|
*"$VERSION"*) ;;
|
||||||
|
*) echo " removing $(basename "$file")"; rm -f "$file" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
rm -rf desktop/release/linux-unpacked desktop/release/win-unpacked
|
||||||
|
|
||||||
case "$TARGET" in
|
case "$TARGET" in
|
||||||
linux) npm --prefix desktop run dist:linux ;;
|
linux) npm --prefix desktop run dist:linux ;;
|
||||||
win) npm --prefix desktop run dist:win ;;
|
win) npm --prefix desktop run dist:win ;;
|
||||||
all) npm --prefix desktop run dist:all ;;
|
all) npm --prefix desktop run dist:all ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
VERSION="$(node -p "require('./desktop/package.json').version")"
|
|
||||||
|
|
||||||
case "$TARGET" in
|
case "$TARGET" in
|
||||||
linux) ARTIFACTS=(-name "*${VERSION}*.deb" -o -name "*${VERSION}*.pkg.tar.zst") ;;
|
linux) ARTIFACTS=(-name "*${VERSION}*.deb" -o -name "*${VERSION}*.pkg.tar.zst") ;;
|
||||||
win) ARTIFACTS=(-name "*${VERSION}*.exe") ;;
|
win) ARTIFACTS=(-name "*${VERSION}*.exe") ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user