fix(ci): Windows 构建用 subst W: 绕过 System32 WOW64 路径重定向
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user