From 717d7dd9b61c79b16f07197cc9872cdfbfb675dd Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 7 Mar 2018 19:47:21 -0800 Subject: [PATCH] Clean build during daily build to ensure MSI package is generate correctly (#6334) Clean build during the daily build to ensure MSI package is generated correctly - Do another clean build directly before packaging to clean up files that test has added # Conflicts: # tools/appveyor.psm1 --- tools/appveyor.psm1 | 15 ++++++++++++++- tools/packaging/packaging.psm1 | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index ef2ab97eb7..f18ad4ba17 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -444,8 +444,13 @@ function Invoke-AppveyorFinish $packageParams += @{Version=$env:APPVEYOR_BUILD_VERSION} } + # Build clean before backing to remove files from testing + Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag -Clean + # Build packages $packages = Start-PSPackage @packageParams -SkipReleaseChecks + $msiObject = $packages | Where-Object { $_ -is [pscustomobject] -and $_.msi } + $msi = $msiObject | Where-Object { $_.msi.EndsWith(".msi") } | Select-Object -ExpandProperty msi $name = Get-PackageName @@ -457,7 +462,15 @@ function Invoke-AppveyorFinish $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) + } } $null = $artifacts.Add($zipFilePath) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index c6e20411c8..ca566693ac 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1656,6 +1656,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}" } }