feat(CI): 添加Flutter安装脚本并改进Windows构建流程
添加install_flutter_simple.bat脚本用于在Windows上自动安装Flutter 改进docker.yml中的Windows构建步骤,增加Flutter路径检测和powershell支持
This commit is contained in:
@@ -189,19 +189,51 @@ jobs:
|
||||
}
|
||||
|
||||
- name: Enable Windows desktop
|
||||
run: flutter config --enable-windows-desktop
|
||||
shell: powershell
|
||||
run: |
|
||||
$flutterPath = Get-Command flutter -ErrorAction SilentlyContinue
|
||||
if (-not $flutterPath) {
|
||||
Write-Host "Flutter not found, checking common locations..."
|
||||
$commonPaths = @(
|
||||
"C:\flutter\bin\flutter.exe",
|
||||
"C:\tools\flutter\bin\flutter.exe",
|
||||
"${env:USERPROFILE}\flutter\bin\flutter.exe"
|
||||
)
|
||||
$flutterFound = $false
|
||||
foreach ($path in $commonPaths) {
|
||||
if (Test-Path $path) {
|
||||
Write-Host "Found Flutter at: $path"
|
||||
$env:PATH = "$(Split-Path $path);$env:PATH"
|
||||
$flutterFound = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (-not $flutterFound) {
|
||||
Write-Host "ERROR: Flutter not found. Please install Flutter first."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
flutter config --enable-windows-desktop
|
||||
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
shell: powershell
|
||||
run: |
|
||||
flutter pub get
|
||||
|
||||
- name: Generate code
|
||||
run: dart run build_runner build --delete-conflicting-outputs
|
||||
shell: powershell
|
||||
run: |
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
|
||||
- name: Build Windows Debug
|
||||
run: flutter build windows
|
||||
shell: powershell
|
||||
run: |
|
||||
flutter build windows
|
||||
|
||||
- name: Build Windows Release
|
||||
run: flutter build windows --release
|
||||
shell: powershell
|
||||
run: |
|
||||
flutter build windows --release
|
||||
|
||||
- name: Upload Debug build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
Reference in New Issue
Block a user