@@ -450,12 +450,25 @@ function Invoke-AppveyorFinish
450
450
try {
451
451
$releaseTag = Get-ReleaseTag
452
452
453
+ # Build clean before backing to remove files from testing
454
+ Start-PSBuild - CrossGen - PSModuleRestore - Configuration ' Release' - ReleaseTag $releaseTag - Clean
455
+
453
456
# Build packages
454
457
$packages = Start-PSPackage - Type msi, nupkg, zip - ReleaseTag $releaseTag - SkipReleaseChecks
458
+ $msiObject = $packages | Where-Object { $_ -is [pscustomobject ] -and $_.msi }
459
+ $msi = $msiObject | Where-Object { $_.msi.EndsWith (" .msi" ) } | Select-Object - ExpandProperty msi
455
460
456
461
$artifacts = New-Object System.Collections.ArrayList
457
462
foreach ($package in $packages ) {
458
- $null = $artifacts.Add ($package )
463
+ if ($package -is [string ])
464
+ {
465
+ $null = $artifacts.Add ($package )
466
+ }
467
+ elseif ($package -is [pscustomobject ] -and $package.msi )
468
+ {
469
+ $null = $artifacts.Add ($package.msi )
470
+ $null = $artifacts.Add ($package.wixpdb )
471
+ }
459
472
}
460
473
461
474
if ($env: APPVEYOR_REPO_TAG_NAME )
@@ -477,8 +490,8 @@ function Invoke-AppveyorFinish
477
490
}
478
491
479
492
# Smoke Test MSI installer
480
- Write-Verbose " Smoke-Testing MSI installer" - Verbose
481
- $msi = $artifacts | Where-Object { $_.EndsWith (" .msi" ) }
493
+ log " Smoke-Testing MSI installer"
494
+ $msi = $artifacts | Where-Object { $_.EndsWith (" .msi" )}
482
495
$msiLog = Join-Path (Get-Location ) ' msilog.txt'
483
496
$msiExecProcess = Start-Process msiexec.exe - Wait - ArgumentList " /I $msi /quiet /l*vx $msiLog " - NoNewWindow - PassThru
484
497
if ($msiExecProcess.ExitCode -ne 0 )
@@ -487,7 +500,8 @@ function Invoke-AppveyorFinish
487
500
$exitCode = $msiExecProcess.ExitCode
488
501
throw " MSI installer failed and returned error code $exitCode . MSI Log was uploaded as artifact."
489
502
}
490
- Write-Verbose " MSI smoke test was successful" - Verbose
503
+
504
+ log " MSI smoke test was successful"
491
505
492
506
# only publish assembly nuget packages if it is a daily build and tests passed
493
507
if ((Test-DailyBuild ) -and $env: TestPassed -eq ' True' )
0 commit comments