From 88091e84c0bf49ddb7233e9dc7595426ba6d05f5 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Sat, 8 Nov 2025 10:05:31 -0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=9A=84Flutter=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=B9=B6=E4=BF=AE=E6=AD=A3CI=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除install_flutter.bat脚本,因为Flutter安装已不再需要 修正docker.yml文件中的换行符问题 --- .gitea/workflows/docker.yml | 126 +----------------------------------- install_flutter.bat | 41 ------------ 2 files changed, 1 insertion(+), 166 deletions(-) delete mode 100644 install_flutter.bat diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index 3cd8796..faf1d3f 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -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." \ No newline at end of file diff --git a/install_flutter.bat b/install_flutter.bat deleted file mode 100644 index 7d43b8e..0000000 --- a/install_flutter.bat +++ /dev/null @@ -1,41 +0,0 @@ -@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 \ No newline at end of file