fix(ci): 增强 Windows 构建中的 build_runner 错误检查
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / build (push) Has been cancelled

- 将 build_runner 步骤独立出来
- 添加 PowerShell 文件存在性检查
- 如果生成的文件不存在则立即失败
- 提供详细的诊断日志

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Rust 2025-10-27 23:41:29 +08:00
parent 875684861e
commit 145832093e

View File

@ -391,8 +391,30 @@ jobs:
- name: 📦 安装 Flutter 依赖
run: |
flutter pub get
- name: 🔧 生成代码文件 (build_runner)
run: |
echo "🔧 开始运行 build_runner..."
flutter pub run build_runner build --delete-conflicting-outputs
echo ""
echo "✅ build_runner 完成,检查生成的文件..."
if (Test-Path "lib\singbox\model\singbox_status.freezed.dart") {
echo "✅ singbox_status.freezed.dart 已生成"
} else {
echo "❌ singbox_status.freezed.dart 未生成"
exit 1
}
if (Test-Path "lib\singbox\service\singbox_service_provider.g.dart") {
echo "✅ singbox_service_provider.g.dart 已生成"
} else {
echo "❌ singbox_service_provider.g.dart 未生成"
exit 1
}
shell: pwsh
- name: 🔨 构建 Windows (Release)
run: |
flutter build windows --release