From 7c8c1a41bc884c8cac3185a10e12d72ac864d831 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 11:39:20 -0800 Subject: [PATCH 1/6] publish heat file if msi generation fails on appveyor --- tools/packaging/packaging.psm1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 96ef5fa8660..ff0946b1813 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2278,6 +2278,18 @@ function Test-FileWxs if(!$passed) { + if($env:appveyor) + { + try + { + Push-AppveyorArtifact $HeatFilesWxsPath + } + catch + { + #ignore any error pushing the artifact + } + } + throw "Current files to not match {$FilesWxsPath}" } } From cc8209d8855d9bc8ab8747bd51cd2e96930527a5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 13:50:51 -0800 Subject: [PATCH 2/6] clean build before packaging --- tools/appveyor.psm1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index b423a2a5618..aa1b9ab9b60 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -450,6 +450,9 @@ function Invoke-AppveyorFinish try { $releaseTag = Get-ReleaseTag + # Build clean before backing to remove files from testing + Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag -Clean + # Build packages $packages = Start-PSPackage -Type msi,nupkg,zip -ReleaseTag $releaseTag -SkipReleaseChecks From 68eb7a8cfef6460c31c3ac63a368d2836704310d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 14:53:28 -0800 Subject: [PATCH 3/6] update for new MSI artifact object type --- tools/appveyor.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index aa1b9ab9b60..1e4a89742ff 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -481,7 +481,7 @@ function Invoke-AppveyorFinish # Smoke Test MSI installer Write-Verbose "Smoke-Testing MSI installer" -Verbose - $msi = $artifacts | Where-Object { $_.EndsWith(".msi") } + $msi = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi.EndsWith(".msi") } $msiLog = Join-Path (Get-Location) 'msilog.txt' $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru if ($msiExecProcess.ExitCode -ne 0) From 4dd4e728a8c3c1c7392988fafca10ea589aa7079 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 15:21:42 -0800 Subject: [PATCH 4/6] [Package] update for new MSI artifact object type --- tools/appveyor.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 1e4a89742ff..9b3a89e7b50 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -481,8 +481,7 @@ function Invoke-AppveyorFinish # Smoke Test MSI installer Write-Verbose "Smoke-Testing MSI installer" -Verbose - $msi = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi.EndsWith(".msi") } - $msiLog = Join-Path (Get-Location) 'msilog.txt' + $msi = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru if ($msiExecProcess.ExitCode -ne 0) { From 1b62b597aadc569b09b5994e80fb0cd00e030fb1 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 18:25:43 -0800 Subject: [PATCH 5/6] [package] make sure only to get the right objects use log function for logging --- tools/appveyor.psm1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 9b3a89e7b50..869d95c387f 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -480,8 +480,10 @@ function Invoke-AppveyorFinish } # Smoke Test MSI installer - Write-Verbose "Smoke-Testing MSI installer" -Verbose - $msi = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi + log "Smoke-Testing MSI installer" + $msiObject = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi } + $msi = $msiObject | Where-Object { $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi + $msiLog = Join-Path (Get-Location) 'msilog.txt' $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru if ($msiExecProcess.ExitCode -ne 0) { @@ -489,7 +491,8 @@ function Invoke-AppveyorFinish $exitCode = $msiExecProcess.ExitCode throw "MSI installer failed and returned error code $exitCode. MSI Log was uploaded as artifact." } - Write-Verbose "MSI smoke test was successful" -Verbose + + log "MSI smoke test was successful" # only publish assembly nuget packages if it is a daily build and tests passed if((Test-DailyBuild) -and $env:TestPassed -eq 'True') From eb22cfbbcdc568a0075f05a48e7c62f7f378a4ab Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 19:03:21 -0800 Subject: [PATCH 6/6] [package] make fix universal for artifact and MSI smoke test --- tools/appveyor.psm1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 869d95c387f..73c28b8388d 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -455,10 +455,20 @@ function Invoke-AppveyorFinish # Build packages $packages = Start-PSPackage -Type msi,nupkg,zip -ReleaseTag $releaseTag -SkipReleaseChecks + $msiObject = $packages | Where-Object { $_ -is [pscustomobject] -and $_.msi } + $msi = $msiObject | Where-Object { $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi $artifacts = New-Object System.Collections.ArrayList foreach ($package in $packages) { - $null = $artifacts.Add($package) + if($package -is [string]) + { + $null = $artifacts.Add($package) + } + elseif($package -is [pscustomobject] -and $package.msi) + { + $null = $artifacts.Add($package.msi) + $null = $artifacts.Add($package.wixpdb) + } } if ($env:APPVEYOR_REPO_TAG_NAME) @@ -481,8 +491,7 @@ function Invoke-AppveyorFinish # Smoke Test MSI installer log "Smoke-Testing MSI installer" - $msiObject = $artifacts | Where-Object { $_ -is [pscustomobject] -and $_.msi } - $msi = $msiObject | Where-Object { $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi + $msi = $artifacts | Where-Object { $_.EndsWith(".msi")} $msiLog = Join-Path (Get-Location) 'msilog.txt' $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru if ($msiExecProcess.ExitCode -ne 0)