ci(workflow): 更新 Flutter 版本至 3.24.3 并添加回退检查
Some checks failed
Build Windows / ACT Windows Checkout Verification (push) Failing after 7h0m20s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 19m50s
Build Windows / build (push) Failing after 7h0m28s

添加 Windows 平台 Flutter 安装脚本,支持版本 3.35.5
This commit is contained in:
shanshanzhong 2025-11-07 09:46:37 -08:00
parent 3b419d1e24
commit 701acd561a
2 changed files with 51 additions and 2 deletions

View File

@ -188,11 +188,19 @@ jobs:
exit 1
}
- name: Setup Flutter
- name: Setup Flutter 3.24.3
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.5'
flutter-version: '3.24.3'
channel: 'stable'
- name: Checkout Flutter 3.35.5
shell: powershell
run: |
Set-Location $env:FLUTTER_ROOT
git fetch --tags
git checkout 3.35.5
flutter --version
- name: Enable Windows desktop
run: flutter config --enable-windows-desktop

41
install_flutter.bat Normal file
View File

@ -0,0 +1,41 @@
@echo off
REM 安装 Flutter SDK on Windows
REM 设置安装目录
set FLUTTER_DIR=C:\flutter
REM 检查是否已安装 Flutter
where flutter >nul 2>nul
if %errorlevel% == 0 (
echo Flutter 已安装,正在检查版本...
flutter --version
goto :end
)
REM 如果未安装,下载 Flutter SDK
echo 下载 Flutter SDK...
powershell -Command "Invoke-WebRequest -Uri 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.35.5-stable.zip' -OutFile 'flutter.zip'"
REM 创建目录
if not exist "%FLUTTER_DIR%" mkdir "%FLUTTER_DIR%"
REM 解压
echo 解压 Flutter SDK 到 %FLUTTER_DIR%...
powershell -Command "Expand-Archive -Path 'flutter.zip' -DestinationPath '%FLUTTER_DIR%' -Force"
REM 添加到 PATH临时
set PATH=%FLUTTER_DIR%\flutter\bin;%PATH%
REM 永久添加 PATH需要管理员权限
echo 请手动将 %FLUTTER_DIR%\flutter\bin 添加到系统 PATH 环境变量。
echo 或者运行以下命令作为管理员:
echo setx /M PATH "%PATH%;%FLUTTER_DIR%\flutter\bin"
REM 运行 flutter doctor
flutter doctor
REM 清理
del flutter.zip
:end
pause