Files
PrimeBuild-pc c9253f879d Enhance CI/release workflow and app robustness
Add comprehensive CI and release improvements (coverage collection, Codecov upload, SBOM generation), split release workflow into build/smoke-test/release stages with deterministic version resolution, artifact uploads, winget manifest updates and changelog generation. Add a pre-commit hook to block large or unwanted artifacts. Introduce runtime improvements: smoke-test startup mode, improved unhandled/dispatcher/task-exception reporting, ThreadPilotException error codes, single-instance behavior adjustments, and logging enhancements. UI and UX changes include a new Logs tab and LogViewer wiring, DWM title-bar theming helper, navigation serialization/unsaved-changes guard, system-tray update backoff logic, and related viewmodel/service integrations. Also add installer template, helper classes, tests, docs, packaging and build scripts, and minor .gitignore updates.
2026-04-15 22:38:35 +02:00

67 lines
1.7 KiB
PowerShell

$ErrorActionPreference = "Stop"
$forbiddenPatterns = @(
"*.log",
"*.pdb",
"*.tmp",
"*.temp"
)
$forbiddenDirectories = @(
".kilo/",
".roo/",
".cursor/",
".aider",
"__pycache__/",
"checkpoint"
)
$maxFileSizeBytes = 100MB
$stagedFiles = git diff --cached --name-only --diff-filter=ACM
if (-not $stagedFiles) {
exit 0
}
$errors = New-Object System.Collections.Generic.List[string]
foreach ($relativePath in $stagedFiles) {
$normalizedPath = $relativePath.Replace('\\', '/').ToLowerInvariant()
foreach ($forbiddenDirectory in $forbiddenDirectories) {
if ($normalizedPath.Contains($forbiddenDirectory.TrimEnd('/').ToLowerInvariant())) {
$errors.Add("Forbidden artifact path staged: $relativePath")
break
}
}
foreach ($pattern in $forbiddenPatterns) {
if ($relativePath -like $pattern) {
$errors.Add("Forbidden file pattern staged: $relativePath")
break
}
}
if (-not (Test-Path -LiteralPath $relativePath)) {
continue
}
$fileInfo = Get-Item -LiteralPath $relativePath -ErrorAction SilentlyContinue
if ($null -ne $fileInfo -and -not $fileInfo.PSIsContainer -and $fileInfo.Length -gt $maxFileSizeBytes) {
$sizeMb = [Math]::Round($fileInfo.Length / 1MB, 2)
$errors.Add("File exceeds 100MB limit: $relativePath ($sizeMb MB)")
}
}
if ($errors.Count -gt 0) {
Write-Host "Pre-commit checks failed:" -ForegroundColor Red
foreach ($error in $errors) {
Write-Host " - $error" -ForegroundColor Red
}
Write-Host "Commit aborted. Clean staged artifacts and retry." -ForegroundColor Yellow
exit 1
}
exit 0