diff --git a/.github/workflows/unsloth-sd-prebuilt.yml b/.github/workflows/unsloth-sd-prebuilt.yml index 71ccff4f8..2c31e6e04 100644 --- a/.github/workflows/unsloth-sd-prebuilt.yml +++ b/.github/workflows/unsloth-sd-prebuilt.yml @@ -825,7 +825,16 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "extract failed: $name" } robocopy (Join-Path $stage $name) $prefix /E /NFL /NDL /NJH /NJS /NP | Out-Null if ($LASTEXITCODE -ge 8) { throw "copy failed: $name ($LASTEXITCODE)" } - Remove-Item -Recurse -Force $zip, (Join-Path $stage $name) + # Cleanup only frees disk; a held-open file here once failed the job and dropped the CUDA 13 assets. + for ($i = 1; $i -le 3; $i++) { + $left = @($zip, (Join-Path $stage $name)) | Where-Object { Test-Path $_ } + if (-not $left) { break } + try { Remove-Item -Recurse -Force $left -ErrorAction Stop; break } + catch { + if ($i -lt 3) { Start-Sleep -Seconds 5 } + else { Write-Warning "staging cleanup left $name behind: $_" } + } + } } "$prefix\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append "CUDA_PATH=$prefix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append