mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add try-catch to on_finish section to prevent hang
This commit is contained in:
+20
-16
@@ -64,19 +64,23 @@ test_script:
|
||||
on_finish:
|
||||
- ps: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
# Creating project artifact
|
||||
$name = git describe
|
||||
$zipFilePath = Join-Path $pwd "$name.zip"
|
||||
$zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip"
|
||||
Add-Type -assemblyname System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath)
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath)
|
||||
|
||||
@(
|
||||
# You can add other artifacts here
|
||||
$zipFilePath,
|
||||
$zipFileFullPath
|
||||
) | % {
|
||||
Write-Host "Pushing package $_ as Appveyor artifact"
|
||||
Push-AppveyorArtifact $_
|
||||
}
|
||||
try {
|
||||
# Creating project artifact
|
||||
$name = git describe
|
||||
$zipFilePath = Join-Path $pwd "$name.zip"
|
||||
$zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip"
|
||||
Add-Type -assemblyname System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath)
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath)
|
||||
|
||||
@(
|
||||
# You can add other artifacts here
|
||||
$zipFilePath,
|
||||
$zipFileFullPath
|
||||
) | % {
|
||||
Write-Host "Pushing package $_ as Appveyor artifact"
|
||||
Push-AppveyorArtifact $_
|
||||
}
|
||||
} catch {
|
||||
Write-Host -Foreground Red $_
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user