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
This commit is contained in:
Travis Plunk
2018-03-07 19:47:21 -08:00
committed by GitHub
parent 46a8976f9a
commit f1c0c2ade5
2 changed files with 30 additions and 4 deletions
+18 -4
View File
@@ -450,12 +450,25 @@ 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
$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)
@@ -477,8 +490,8 @@ function Invoke-AppveyorFinish
}
# Smoke Test MSI installer
Write-Verbose "Smoke-Testing MSI installer" -Verbose
$msi = $artifacts | Where-Object { $_.EndsWith(".msi") }
log "Smoke-Testing MSI installer"
$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)
@@ -487,7 +500,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')
+12
View File
@@ -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}"
}
}