앱 빌드시 버전갱신 문제

This commit is contained in:
Macbook
2026-06-14 19:54:53 +09:00
parent ac2b0eb7f1
commit a6a3bfbe38
3 changed files with 60 additions and 11 deletions
+26 -2
View File
@@ -119,17 +119,41 @@ collect_updater_artifacts() {
done
}
copy_installer_matching_version() {
local kind="$1"
shift
local found=""
while IFS= read -r f; do
[[ -z "$f" ]] && continue
if [[ "$f" == *"${VERSION}"* ]]; then
found="$f"
break
fi
done < <("$@")
if [[ -z "$found" ]]; then
echo "ERROR: ${kind} installer for v${VERSION} not found (stale target cache ignored)." >&2
echo " Searched: $*" >&2
return 1
fi
cp -f "$found" "$ARTIFACT_DIR/"
echo " ${kind} installer: $(basename "$found")"
}
if [[ "$BUILD_MAC" -eq 1 ]]; then
echo "--- Tauri build (macOS) ---"
find "$TAURI_TARGET/release/bundle" -name '*.dmg' -delete 2>/dev/null || true
(cd "$DESKTOP_DIR" && npm run tauri:build:mac)
find "$TAURI_TARGET/release/bundle" -name '*.dmg' -exec cp -f {} "$ARTIFACT_DIR/" \; 2>/dev/null || true
copy_installer_matching_version "macOS" \
find "$TAURI_TARGET/release/bundle" -name '*.dmg' 2>/dev/null
collect_updater_artifacts
fi
if [[ "$BUILD_WIN" -eq 1 ]]; then
echo "--- Tauri build (Windows NSIS cross) ---"
find "$TAURI_TARGET" -path '*x86_64-pc-windows-msvc*' -name '*-setup.exe' -delete 2>/dev/null || true
(cd "$DESKTOP_DIR" && npm run tauri:build:win)
find "$TAURI_TARGET" -path '*x86_64-pc-windows-msvc*' -name '*-setup.exe' -exec cp -f {} "$ARTIFACT_DIR/" \; 2>/dev/null || true
copy_installer_matching_version "Windows" \
find "$TAURI_TARGET" -path '*x86_64-pc-windows-msvc*' -name '*-setup.exe' 2>/dev/null
collect_updater_artifacts
fi
+29 -5
View File
@@ -35,16 +35,40 @@ log "Web static: $WEB_STATIC_DIR"
mkdir -p "$WEB_STATIC_DIR"
prune_old_installers() {
local dir="$1"
[[ -d "$dir" ]] || return 0
find "$dir" -maxdepth 1 -type f \( \
-name 'GoldenChart_*.dmg' -o \
-name 'GoldenChart_*setup.exe' -o \
-name 'GoldenChart_*-setup.exe' \
\) -delete 2>/dev/null || true
}
# 설치 파일(dist-desktop/*.dmg, *setup.exe) 복사 — nginx static + backend API 디렉터리
if [[ -d "$ARTIFACT_DIR" ]]; then
mkdir -p "$DESKTOP_RELEASE_DIR"
# 구버전 설치 파일 제거 (Windows exe 0.1.3 잔존 등 방지)
find "$DESKTOP_RELEASE_DIR" -maxdepth 1 -type f \( -name 'GoldenChart_*.dmg' -o -name 'GoldenChart_*setup.exe' -o -name 'GoldenChart_*-setup.exe' \) -delete 2>/dev/null || true
find "$ARTIFACT_DIR" -maxdepth 1 -type f \( -name '*.dmg' -o -name '*setup.exe' \) | while read -r f; do
prune_old_installers "$DESKTOP_RELEASE_DIR"
prune_old_installers "$WEB_STATIC_DIR"
INSTALLER_COUNT=0
while IFS= read -r f; do
[[ -z "$f" ]] && continue
base="$(basename "$f")"
if [[ "$base" != *"${VERSION}"* ]]; then
log "[WARN] skip installer (version mismatch): $base (expected v${VERSION})"
continue
fi
cp -f "$f" "$WEB_STATIC_DIR/"
cp -f "$f" "$DESKTOP_RELEASE_DIR/"
log "Installer: $(basename "$f")"
done
log "Installer: $base"
INSTALLER_COUNT=$((INSTALLER_COUNT + 1))
done < <(find "$ARTIFACT_DIR" -maxdepth 1 -type f \( -name '*.dmg' -o -name '*setup.exe' \) 2>/dev/null)
if [[ "$INSTALLER_COUNT" -eq 0 ]]; then
log "[WARN] v${VERSION} 설치 파일(dmg/exe) 없음 — latest.json 만 갱신될 수 있음"
fi
if [[ -f "$BUILD_INFO" ]]; then
cp -f "$BUILD_INFO" "$DESKTOP_RELEASE_DIR/build-info.json"
fi