ci: 移除不再需要的Flutter安装脚本并修正CI文件格式
移除install_flutter.bat脚本,因为Flutter安装已不再需要 修正docker.yml文件中的换行符问题
This commit is contained in:
+1
-125
@@ -190,8 +190,7 @@ jobs:
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
|
||||
|
||||
- name: Enable Windows desktop
|
||||
run: flutter config --enable-windows-desktop
|
||||
@@ -219,126 +218,3 @@ jobs:
|
||||
with:
|
||||
name: windows-release-build
|
||||
path: build/windows/runner/Release/
|
||||
|
||||
# 本地(act)验证作业:只验证 Git PATH 与 checkout/submodules
|
||||
build-act-windows:
|
||||
name: ACT Windows Checkout Verification
|
||||
if: ${{ env.ACT == 'true' }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Add Git to PATH (Windows)
|
||||
shell: powershell
|
||||
run: |
|
||||
$paths = @(
|
||||
'C:\Program Files\Git\cmd',
|
||||
'C:\Program Files\Git\bin',
|
||||
'C:\Program Files (x86)\Git\cmd',
|
||||
'C:\Program Files (x86)\Git\bin'
|
||||
)
|
||||
foreach ($p in $paths) {
|
||||
if (Test-Path $p) {
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $p
|
||||
$env:PATH = "$p;$env:PATH"
|
||||
Write-Host ("Added to PATH: {0}" -f $p)
|
||||
}
|
||||
}
|
||||
$candidates = @(
|
||||
'C:\Program Files\Git\cmd\git.exe',
|
||||
'C:\Program Files\Git\bin\git.exe',
|
||||
'C:\Program Files (x86)\Git\cmd\git.exe',
|
||||
'C:\Program Files (x86)\Git\bin\git.exe'
|
||||
)
|
||||
$found = $false
|
||||
foreach ($g in $candidates) {
|
||||
if (Test-Path $g) {
|
||||
& $g --version
|
||||
$found = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (-not $found) {
|
||||
Write-Host "Git executable not found in common locations; continuing."
|
||||
}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
# 仅用于本地 act 验证:目录级稀疏检出,避免包含 Windows 非法文件
|
||||
sparse-checkout: |
|
||||
.github
|
||||
lib
|
||||
libcore
|
||||
android
|
||||
ios
|
||||
windows
|
||||
assets/core
|
||||
assets/fonts
|
||||
assets/translations
|
||||
sparse-checkout-cone: true
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.35.5'
|
||||
channel: 'stable'
|
||||
- name: Enable Windows desktop
|
||||
run: flutter config --enable-windows-desktop
|
||||
|
||||
- name: 🔍 Verify jq Installation (ACT)
|
||||
shell: powershell
|
||||
run: |
|
||||
# Check if jq is available
|
||||
$jqFound = $false
|
||||
try {
|
||||
$version = jq --version 2>&1
|
||||
if ($version -match 'jq-[\d\.]+') {
|
||||
Write-Host "jq is already installed: $version"
|
||||
$jqFound = $true
|
||||
}
|
||||
} catch {
|
||||
Write-Host "jq not installed or not in PATH"
|
||||
}
|
||||
if (-not $jqFound) {
|
||||
Write-Host "Preparing to install jq..."
|
||||
# Check if Chocolatey is available
|
||||
$chocoFound = $false
|
||||
try {
|
||||
choco --version 2>&1 | Out-Null
|
||||
$chocoFound = $true
|
||||
} catch {}
|
||||
if (-not $chocoFound) {
|
||||
Write-Host "Installing Chocolatey..."
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
# Refresh PATH
|
||||
$env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
|
||||
Write-Host "Chocolatey installed successfully"
|
||||
}
|
||||
Write-Host "Installing jq using Chocolatey..."
|
||||
choco install jq -y
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "jq installed successfully"
|
||||
# Verify again
|
||||
$version = jq --version 2>&1
|
||||
Write-Host "jq version: $version"
|
||||
} else {
|
||||
Write-Host "jq installation failed, exit code: $LASTEXITCODE"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
- name: Verify submodules
|
||||
shell: powershell
|
||||
continue-on-error: true
|
||||
run: |
|
||||
git --version
|
||||
git submodule status
|
||||
Write-Host "Submodules verified (status printed above)."
|
||||
|
||||
- name: Summary
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Host "ACT Windows verification completed successfully."
|
||||
Reference in New Issue
Block a user