From a3f9f091b44bcf3b5a331613e6b18661f543bf19 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 1 Jun 2026 01:19:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20Windows=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=94=A8=20subst=20W:=20=E7=BB=95=E8=BF=87=20System32=20WOW64?= =?UTF-8?q?=20=E8=B7=AF=E5=BE=84=E9=87=8D=E5=AE=9A=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/compile-windows.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/ci/compile-windows.sh b/scripts/ci/compile-windows.sh index b50d498..ba24859 100755 --- a/scripts/ci/compile-windows.sh +++ b/scripts/ci/compile-windows.sh @@ -15,25 +15,28 @@ echo "==> compile-windows: version=${VER}" sed -i "s/^version:.*/version: ${VER}+1/" client/pubspec.yaml # Build Flutter Windows -cd client -echo "==> pwd: $(pwd)" -echo "==> windows/ before create: $(test -d windows && echo EXISTS || echo MISSING)" +# Use subst to create a short path (W:) to avoid WOW64 redirection issue +# when workspace is under C:\Windows\System32\config\systemprofile +WORKSPACE_WIN=$(cygpath -w "$(pwd)") +echo "==> workspace: $WORKSPACE_WIN" +cmd //c "subst W: \"${WORKSPACE_WIN}\"" || true + +cd /w/client flutter create --platforms=windows . --project-name jiu_client -echo "==> windows/ after create: $(test -d windows && echo EXISTS || echo MISSING)" -echo "==> windows/CMakeLists.txt: $(test -f windows/CMakeLists.txt && echo EXISTS || echo MISSING)" -ls windows/ 2>&1 || echo "(ls failed)" flutter build windows --release \ "--dart-define=BASE_URL=https://jiu.51yanmei.com" \ "--dart-define=PUBLIC_URL=https://jiu.51yanmei.com" \ "--dart-define=APP_VERSION=${TAG}" -cd .. +cd /w + +cmd //c "subst W: /d" || true # Package release folder into zip using Python (available on all platforms) mkdir -p dist python3 - <<'PYEOF' import zipfile, os -src = os.path.join('client', 'build', 'windows', 'x64', 'runner', 'Release') +src = os.path.join('W:\\', 'client', 'build', 'windows', 'x64', 'runner', 'Release') if os.path.exists('W:\\') else os.path.join('client', 'build', 'windows', 'x64', 'runner', 'Release') dst = os.path.join('dist', 'jiu-windows-x64.zip') with zipfile.ZipFile(dst, 'w', zipfile.ZIP_DEFLATED) as zf: