Repository navigation
chore: disable Windows CI workflow and update release process - #281
Conversation
This commit adds a new GitHub Actions workflow for Windows CI, which includes: - Clearing FVM and Flutter caches before building. - Setting up Visual Studio C++ tools using `ilammy/msvc-dev-cmd@v1`. - Installing Inno Setup for packaging the application. - Using CMake presets defined in `src/windows/CMakeUserPresets.json` for configuring the build environment on Windows.
Flutter's build windows command hardcodes Visual Studio 16 2019 as the CMake generator. The windows-latest runner now has Visual Studio 18 2026, which Flutter doesn't recognize. Solution: Use windows-2019 runner which has Visual Studio 16 2019 installed. This simplifies the workflow by removing all the experimental workarounds that were attempting to force Flutter to use Visual Studio 18 2026.
- Install NuGet CLI and configure nuget.org package source - Add NUGET_EXECUTABLE environment variable for CMake - Replace RPS code generation with direct build_runner commands - Update all composite actions to support Windows (PowerShell) - Add comprehensive build cache cleaning - Fix BUILD_TYPE persistence using GITHUB_OUTPUT instead of GITHUB_ENV - Add .gitattributes for proper line endings (LF for scripts, CRLF for Windows files) - Add .actrc for local act testing with self-hosted runner - Skip artifact uploads when running locally with act (no ACTIONS_RUNTIME_TOKEN) The Windows CI build now completes successfully and generates both the portable executable and Inno Setup installer.
- Rename get-version to get-version-unix and get-version-windows - Rename extract-version to extract-version-unix and extract-version-windows - Update output references to use || operator for cross-platform compatibility
Explicitly configure CMake to use Visual Studio 17 2022 generator. Flutter's vswhere detection may fail on windows-latest if C++ workload is not properly configured, so we bypass detection with this preset.
Flutter requires VS with 'Desktop development with C++' workload to detect Visual Studio. Install VCTools workload and CMake components to ensure vswhere detection succeeds on windows-latest.
Flutter ignores CMakeUserPresets.json and always uses its own detection. Pre-generating CMake files with VS 17 2022 creates CMakeCache.txt that Flutter will reuse, forcing the correct generator.
- Remove broken CMake pre-generation step (ephemeral files don't exist yet) - Remove VS Build Tools installation (windows-latest has VS 2022) - Add detailed Visual Studio detection debugging - Let Flutter detect VS 2022 from default installation
Separate debug workflow to quickly test VS detection issues without running the full 5+ minute build process.
- Add intl ^0.19.0 to dependency_overrides - Fixes dart_json_mapper compatibility with Flutter 3.38.0
- Add CMAKE_GENERATOR env var to override Flutter's VS detection - Add VS installations debug info - Flutter 3.38.0 cannot detect VS 2026 on windows-latest - Forces use of VS 2022 generator which should be available
- Disabled flutter-ci.windows.yml (renamed to .yml.disabled) - Added documentation at docs/windows-ci-disabled.md - Flutter 3.38.0 cannot detect Visual Studio 2026 on windows-latest - Manual Windows builds required until Flutter adds VS 2026 support - References: flutter/flutter#176399, actions/runner-images#11384 Temporary workaround: maintainer will build manually and upload to releases.
- Disabled automatic tag push triggers - Manual workflow_dispatch only (for testing purposes) - File preserved for future re-enablement - See docs/windows-ci-disabled.md for details
- Flutter version: 3.38.0 → 3.32.0 (.fvmrc) - intl dependency: ^0.19.0 → ^0.20.2 (removed override) - .fvm/fvm_config.json updated locally (not tracked) - acore submodule has uncommitted intl change (needs separate commit) Windows CI remains disabled. Manual builds required.
- Changed from flutter: "3.38.0" to ">=3.24.0 <4.0.0" - Allows using Flutter 3.32.0 (current FVM version) - Maintains compatibility with Flutter 3.x versions
- Removed "Flutter CI - Windows" from workflow triggers - Removed Windows from WORKFLOWS arrays - Commented out Windows portable and installer file preparation - Removed Windows files from release artifacts - Updated release notes to indicate Windows builds are temporarily disabled - References docs/windows-ci-disabled.md for details
There was a problem hiding this comment.
Code Review
This pull request adds documentation regarding the temporary suspension of Windows CI due to compatibility issues between Flutter 3.38.0 and Visual Studio 2026, and updates the Flutter SDK constraints. Feedback indicates that the pubspec.lock file is out of sync with pubspec.yaml, and the expanded SDK range inadvertently includes the problematic Flutter version. Additionally, it is recommended to use placeholders for version numbers in the documentation to enhance maintainability.
| sdks: | ||
| dart: ">=3.8.0 <4.0.0" | ||
| flutter: ">=3.32.0" | ||
| flutter: ">=3.29.0" |
There was a problem hiding this comment.
The flutter SDK constraint in pubspec.lock (">=3.29.0") does not match the constraint defined in pubspec.yaml (">=3.24.0 <4.0.0"). Additionally, the dart constraint on line 1705 (">=3.8.0 <4.0.0") is also out of sync with the pubspec.yaml's sdk: ^3.5.3. This inconsistency suggests the lock file was manually edited or generated in an environment that doesn't align with the project's configuration. It is recommended to run flutter pub get to properly synchronize the lock file.
flutter: ">=3.24.0 <4.0.0"
| environment: | ||
| sdk: ^3.5.3 | ||
| flutter: "3.32.0" | ||
| flutter: ">=3.24.0 <4.0.0" |
There was a problem hiding this comment.
The Flutter SDK constraint has been widened from a pinned 3.32.0 to a broad range ">=3.24.0 <4.0.0". Given that Flutter 3.38.0 is identified as problematic in docs/windows-ci-disabled.md, this range allows the use of the broken version. If the intent is to avoid 3.38.0 while allowing other versions, consider using a more specific range or an upper bound that excludes it (e.g., "<3.38.0"). Additionally, downgrading the minimum version to 3.24.0 seems unnecessary if the project was already stable on 3.32.0.
0bbc9d0 to
231a0dd
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive Windows support for GitHub Actions by implementing PowerShell-based logic for version extraction, dependency management, FVM setup, and repository initialization. It also adds documentation regarding Visual Studio 2026 compatibility issues and a new CMake user preset. Feedback identifies several critical improvements: correcting an invalid Android toolchain reference in the Windows CMake preset, broadening the version extraction regex to handle versions without build numbers, and avoiding hardcoded installation paths for the Dart SDK in favor of temporary runner directories.
| "CMAKE_TOOLCHAIN_FILE": { | ||
| "type": "FILEPATH", | ||
| "value": "$env{FlutterRoot}/packages/flutter_tools/gradle/cmake/android.toolchain.cmake" | ||
| } |
There was a problem hiding this comment.
The CMAKE_TOOLCHAIN_FILE is incorrectly pointing to an Android toolchain file (android.toolchain.cmake), which is not applicable for Windows desktop builds. Furthermore, it references $env{FlutterRoot}, which is not a standard environment variable for the Flutter SDK (typically FLUTTER_ROOT). Since this is a Windows preset, you should likely remove this toolchain override unless a specific Windows toolchain is required.
| if ($pubspecContent -match 'version:\s*([\d.]+\+\d+)') { | ||
| $FULL_VERSION = $matches[1] | ||
| echo "version=$FULL_VERSION" >> $env:GITHUB_OUTPUT | ||
| Write-Host "Full version: $FULL_VERSION" | ||
|
|
||
| # Split version and build number | ||
| $VERSION_NUMBER, $BUILD_NUMBER = $FULL_VERSION -split '\+' | ||
|
|
||
| echo "version-number=$VERSION_NUMBER" >> $env:GITHUB_OUTPUT | ||
| echo "build-number=$BUILD_NUMBER" >> $env:GITHUB_OUTPUT | ||
|
|
||
| Write-Host "Version number: $VERSION_NUMBER" | ||
| Write-Host "Build number: $BUILD_NUMBER" | ||
|
|
||
| # Set environment variables for backward compatibility | ||
| echo "APP_VERSION=$FULL_VERSION" >> $env:GITHUB_ENV | ||
| } else { | ||
| Write-Host "❌ Failed to extract version from pubspec.yaml" | ||
| exit 1 | ||
| } |
There was a problem hiding this comment.
The regular expression 'version:\s*([\d.]+\+\d+)' is too restrictive because it mandates a build number (the + followed by digits). If the pubspec.yaml contains a version without a build number (e.g., 1.0.0), this step will fail. It is recommended to use a more inclusive regex and handle the optional build number logic separately to ensure robustness, similar to the Unix implementation.
if ($pubspecContent -match 'version:\s*([^\s#]+)') {
$FULL_VERSION = $matches[1]
echo "version=$FULL_VERSION" >> $env:GITHUB_OUTPUT
Write-Host "Full version: $FULL_VERSION"
# Split version and build number
if ($FULL_VERSION -match '\+') {
$VERSION_NUMBER, $BUILD_NUMBER = $FULL_VERSION -split '\+'
} else {
$VERSION_NUMBER = $FULL_VERSION
$BUILD_NUMBER = ""
}
echo "version-number=$VERSION_NUMBER" >> $env:GITHUB_OUTPUT
echo "build-number=$BUILD_NUMBER" >> $env:GITHUB_OUTPUT
Write-Host "Version number: $VERSION_NUMBER"
Write-Host "Build number: $BUILD_NUMBER"
# Set environment variables for backward compatibility
echo "APP_VERSION=$FULL_VERSION" >> $env:GITHUB_ENV
} else {
Write-Host "❌ Failed to extract version from pubspec.yaml"
exit 1
}| $dartVersion = "stable" | ||
| $dartUrl = "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-windows-x64-release.zip" | ||
| $dartOutput = "$env:TEMP\dart-sdk.zip" | ||
| $dartInstallDir = "C:\dart-sdk" |
There was a problem hiding this comment.
Hardcoding the installation path to C:\dart-sdk is not recommended for CI environments. It may lead to permission issues or conflicts, especially on self-hosted runners where files from previous runs might persist. It is safer to use the runner's temporary directory, such as $env:RUNNER_TEMP.
$dartInstallDir = Join-Path $env:RUNNER_TEMP "dart-sdk"
🚀 Motivation and Context
Disable Windows CI workflow due to Flutter incompatibility with Visual Studio 2026 on windows-latest runner. Update release process to exclude Windows artifacts and add documentation explaining the situation.
⚙️ Implementation Details
Changes made:
📋 Checklist for Reviewer
This PR maintains the current stable state while documenting why Windows CI is disabled for future reference and includes improvements to the Windows build process for when it is re-enabled.