添加install_flutter_simple.bat脚本用于在Windows上自动安装Flutter 改进docker.yml中的Windows构建步骤,增加Flutter路径检测和powershell支持
44 lines
1.3 KiB
Batchfile
44 lines
1.3 KiB
Batchfile
@echo off
|
|
REM Simple Flutter installer for Windows Gitea Runner
|
|
|
|
echo Installing Flutter for Windows...
|
|
|
|
REM Create flutter directory
|
|
mkdir C:\flutter 2>nul
|
|
|
|
REM Download Flutter stable version
|
|
echo Downloading Flutter...
|
|
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.24.5-stable.zip', 'C:\flutter.zip')"
|
|
|
|
if %errorlevel% neq 0 (
|
|
echo Download failed, trying alternative...
|
|
powershell -Command "Invoke-WebRequest -Uri 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.24.5-stable.zip' -OutFile 'C:\flutter.zip'"
|
|
)
|
|
|
|
REM Extract Flutter
|
|
echo Extracting Flutter...
|
|
powershell -Command "Expand-Archive -Path 'C:\flutter.zip' -DestinationPath 'C:\' -Force"
|
|
|
|
REM Set PATH
|
|
echo Setting PATH...
|
|
set PATH=C:\flutter\bin;%PATH%
|
|
setx PATH "C:\flutter\bin;%PATH%"
|
|
|
|
REM Clean up
|
|
del C:\flutter.zip
|
|
|
|
REM Verify installation
|
|
echo Verifying Flutter installation...
|
|
C:\flutter\bin\flutter --version
|
|
|
|
if %errorlevel% equ 0 (
|
|
echo SUCCESS: Flutter installed successfully
|
|
echo Running flutter doctor...
|
|
C:\flutter\bin\flutter doctor
|
|
) else (
|
|
echo ERROR: Flutter installation failed
|
|
exit /b 1
|
|
)
|
|
|
|
echo Flutter installation complete!
|
|
pause |