fix(t72): build-windows.sh 補版本注入(Mac 有、Windows 漏了)+tray go.mod tidy

實測抓到:Windows 版編出來 v0.10.0 命中 0——版本注入只加在 build-mac.sh,
Windows 那支漏了(我今天改的那份在 detached worktree,沒進分支)。

v0.10.0 兩平台實測:
  Mac  zip 15.92MB|托盤 21.15MB(strip)|collector 14.46MB(含 PDFium)
  Win  zip 16.86MB|tray 22.40MB|collector 15.15MB
  兩者皆 < jsDelivr 20MB
  指紋全中:v0.10.0/版本列/結束 Arcrun RAG/PDF 打不開(轉檔層)

順帶修:tray go.mod 需 tidy 才編得過(合併後又被覆蓋,撞了兩次)。
This commit is contained in:
2026-07-27 21:17:50 +08:00
parent a0a7215d24
commit 1b58cd1a35
3 changed files with 18 additions and 11 deletions
+8 -1
View File
@@ -18,6 +18,13 @@
set -euo pipefail
cd "$(dirname "$0")"
# 版本編號(leo 2026-07-27:「daemon 要加上版本編號」)——與 build-mac.sh 同一套。
# 沒版本號時只能靠 shasum 對帳,使用者根本做不到(見 daemon-beta tasks t63)。
VERSION="${VERSION:-$(git describe --tags --always --dirty 2>/dev/null || echo dev)}"
BUILD_TIME="$(date '+%Y%m%d-%H%M')"
LDFLAGS_VER="-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}"
echo "🏷 版本:${VERSION}build ${BUILD_TIME}"
OUT="dist-windows"
CC_WIN="${CC_WIN:-x86_64-w64-mingw32-gcc}"
@@ -36,7 +43,7 @@ echo "② 編 collector.exe(純 stdlibCGO_ENABLED=0 即可)"
echo "③ 編托盤 GUIfyneCGo+GL,走 mingw-H windowsgui=不彈黑色命令列視窗)"
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="$CC_WIN" \
go build -ldflags "-H windowsgui -s -w" -o "$OUT/arcrun-tray.exe" .
go build -ldflags "-H windowsgui -s -w ${LDFLAGS_VER}" -o "$OUT/arcrun-tray.exe" .
echo "④ 打包 zip"
( cd "$OUT" && zip -9 -q ArcrunRAG-win-unsigned.zip arcrun-tray.exe arcrun-collector.exe )