From aaffe85a4f6c0303cc36335cf26908fff8f22a77 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 7 Jul 2026 19:05:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci/windows):=20=E5=90=8C=E6=AD=A5=20Flutter?= =?UTF-8?q?=20app=20=E7=89=88=E6=9C=AC=E5=88=B0=20tag(=E5=8E=9F=E5=8D=A1?= =?UTF-8?q?=E5=9C=A8=20pubspec=201.0.48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit compile-windows 此前只 sed Inno 安装器 MyAppVersion,没改 Flutter pubspec 版本, 导致 Windows 包内 package_info 永远是 committed 的 1.0.48 → 设置页显示旧版 + 自动更新永远判"有新版"。补上 build number 计算 + sed 复制后的 pubspec.yaml (GNU sed,windows runner),与 android/macos 对齐。 Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u --- scripts/ci/compile-windows.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/ci/compile-windows.sh b/scripts/ci/compile-windows.sh index 9f18390..aaacbfb 100755 --- a/scripts/ci/compile-windows.sh +++ b/scripts/ci/compile-windows.sh @@ -51,7 +51,15 @@ VER="" read -r VER < "$ver_file" || true # 无结尾换行的 read 退出码,见 compile-android.sh 同注释 rm -f "$ver_file" -echo "==> compile-windows: tag=${TAG} version=${VER}" +# build number 同 android/macos 规则(MAJOR*10000+MINOR*100+PATCH)。 +MAJOR="${VER%%.*}" +_REST="${VER#*.}" +MINOR="${_REST%%.*}" +PATCH="${_REST#*.}" +PATCH="${PATCH%%-*}" +BUILD=$(( MAJOR * 10000 + MINOR * 100 + PATCH )) + +echo "==> compile-windows: tag=${TAG} version=${VER} build=${BUILD}" API_URL="${PANGOLIN_API_URL:-https://api.yanmeiai.com}" @@ -79,6 +87,12 @@ rm -rf "${BUILD_CLIENT}/windows/flutter/ephemeral" \ "${BUILD_CLIENT}/.dart_tool" \ "${BUILD_CLIENT}/build" +# 同步 Flutter app 版本到 tag(GNU sed,windows runner)。否则 package_info 卡在 +# pubspec committed 值(1.0.48),设置页显示旧版 + 自动更新永远判"有新版"。 +# 此前只改了 Inno 安装器 MyAppVersion(下方),App 内部版本没跟上——本次修复。 +sed -i "s/^version:.*/version: ${VER}+${BUILD}/" "${BUILD_CLIENT}/pubspec.yaml" +echo "==> compile-windows: pubspec version -> ${VER}+${BUILD}" + # ── [3/4] build ────────────────────────────────────────────────────────────── # NOTE(controller): `flutter create` on an existing project only fills in # scaffolding it manages (ephemeral/, generated_plugins.cmake, ...) and should