feat(t72): daemon 加版本編號(leo 07-27:沒版本號=只能靠 shasum 對帳)
病根:在此之前無法從畫面看出裝的是哪一版。07-27 花大半天對帳 「leo 手上/鏡像上/剛編的」是否同一顆,只能 shasum 比對 binary; 使用者更做不到這件事,回報問題時我們也不知道他跑的是哪版(t63 三層落差)。 做法: - main.go 加 version/buildTime 變數,build 時 -ldflags -X 注入,未注入顯示 dev - 托盤選單「結束」正上方加停用態版本列(回報問題時眼睛已在那一區) - build-mac.sh / build-windows.sh 同一套:VERSION 環境變數 > git describe > dev 實測(兩平台各實跑一次 VERSION=v0.9.0): Mac 托盤 21.1MB/zip 12.43MB/v0.9.0 命中 3/版本列 1/結束 1/連上知識庫 1 Win zip 13.27MB/PE32+ GUI/v0.9.0 命中 3/版本列 1/結束 1/連上知識庫 1 兩包皆 < jsDelivr 20MB 上限 未驗:選單版本列的實際顯示(Mac 需 leo 點選單、Windows 需真機)。
This commit is contained in:
@@ -10,6 +10,14 @@
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# 版本編號(leo 2026-07-27:「daemon 要加上版本編號」)——沒版本號就只能靠 shasum 對帳,
|
||||
# 使用者回報問題時我們也不知道他跑的是哪一版(見 t63「修好的東西傳不到用戶」)。
|
||||
# 用法:VERSION=v0.9.0 bash build-mac.sh(未給則用 git 描述,再不行才 dev)
|
||||
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})"
|
||||
|
||||
echo "① 編 collector(同綑執行檔)"
|
||||
( cd ../.. && go build -ldflags "-s -w" -o "cmd/arcrun-tray/arcrun-collector" . )
|
||||
|
||||
@@ -22,9 +30,8 @@ go run fyne.io/fyne/v2/cmd/fyne@latest package -os darwin -icon icon.png -name "
|
||||
# =**掉進 jsDelivr 單檔 20MB 上限內**(此前 Mac 版超標,jsDelivr 直接回
|
||||
# "File size exceeded the configured limit of 20 MB.",只能走 raw;Windows 版 13MB 無此問題)。
|
||||
# ⇒ 這一步讓 Mac 版也能走 CDN,且**免除拆檔工程**。功能指紋與簽章實測皆不受影響。
|
||||
echo "②b strip 重編托盤(-s -w;為了掉進 jsDelivr 20MB 線內)"
|
||||
go build -ldflags "-s -w" -o "$(ls -d *.app 2>/dev/null | head -1)/Contents/MacOS/arcrun-tray" . 2>/dev/null \
|
||||
|| go build -ldflags "-s -w" -o "Arcrun RAG.app/Contents/MacOS/arcrun-tray" .
|
||||
echo "②b strip 重編托盤(-s -w;為了掉進 jsDelivr 20MB 線內)+注入版本號"
|
||||
go build -ldflags "-s -w ${LDFLAGS_VER}" -o "Arcrun RAG.app/Contents/MacOS/arcrun-tray" .
|
||||
|
||||
APP="Arcrun RAG.app"
|
||||
PLIST="$APP/Contents/Info.plist"
|
||||
|
||||
Reference in New Issue
Block a user