Fix daily CI builds to publish tar package as artifacts (#8775)

Update the packaging script to always create the tar.gz packages.

## PR Context  

Daily builds for Linux and MacOS do not publish tar.gz package.
This commit is contained in:
Aditya Patwardhan
2019-02-04 14:53:25 -08:00
committed by Travis Plunk
parent 130298bfae
commit ec12f373ec
5 changed files with 45 additions and 17 deletions
+2 -2
View File
@@ -102,9 +102,9 @@ jobs:
# Uploads any packages as an artifact
- powershell: |
Get-ChildItem -Path *.rpm, *.deb, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Get-ChildItem -Path ${env:BUILD_ARTIFACTSTAGINGDIRECTORY} -Include *.nupkg, *.rpm, *.deb, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
}
displayName: Publish Artifacts
condition: ne(variables['Build.Reason'], 'PullRequest')
condition: succeededOrFailed()
continueOnError: true
+2 -2
View File
@@ -77,9 +77,9 @@ jobs:
# Uploads any packages as an artifact
- powershell: |
Get-ChildItem -Path *.pkg, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Get-ChildItem -Path ${env:BUILD_ARTIFACTSTAGINGDIRECTORY} -Include *.nupkg, *.pkg, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
}
displayName: Publish Artifacts
condition: ne(variables['Build.Reason'], 'PullRequest')
condition: succeededOrFailed()
continueOnError: true
+3 -3
View File
@@ -401,14 +401,14 @@ function Invoke-AppVeyorAfterTest
Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
$codeCoverageArtifacts | ForEach-Object {
Push-Artifact -Path $_
Push-Artifact -Path $_ -Name 'CodeCoverage'
}
New-TestPackage -Destination (Get-Location).Path
$testPackageFullName = Join-Path $pwd 'TestPackage.zip'
Write-Verbose "Created TestPackage.zip" -Verbose
Write-Host -ForegroundColor Green 'Upload test package'
Push-Artifact $testPackageFullName
Push-Artifact $testPackageFullName -Name 'artifacts'
}
}
@@ -568,7 +568,7 @@ function Invoke-AppveyorFinish
Write-Host "Pushing $_ as Appveyor artifact"
if(Test-Path $_)
{
Push-Artifact -Path $_
Push-Artifact -Path $_ -Name 'artifacts'
}
else
{
+8 -8
View File
@@ -243,16 +243,16 @@ function Start-PSPackage {
if (-not $Type) {
$Type = if ($Environment.IsLinux) {
if ($Environment.LinuxInfo.ID -match "ubuntu") {
"deb", "nupkg"
"deb", "nupkg", "tar"
} elseif ($Environment.IsRedHatFamily) {
"rpm", "nupkg"
"rpm", "nupkg", "tar"
} elseif ($Environment.IsSUSEFamily) {
"rpm", "nupkg"
"rpm", "nupkg", "tar"
} else {
throw "Building packages for $($Environment.LinuxInfo.PRETTY_NAME) is unsupported!"
}
} elseif ($Environment.IsMacOS) {
"osxpkg", "nupkg"
"osxpkg", "nupkg", "tar"
} elseif ($Environment.IsWindows) {
"msi", "nupkg"
}
@@ -521,7 +521,7 @@ function New-TarballPackage {
if (Test-Path -Path $packagePath) {
Write-Log "You can find the tarball package at $packagePath"
return $packagePath
return (Get-Item $packagePath)
} else {
throw "Failed to create $packageName"
}
@@ -952,7 +952,7 @@ function New-MacOsDistributionPackage
try
{
# productbuild is an xcode command line tool, and those tools are installed when you install brew
Start-NativeExecution -sb {productbuild --distribution $distributionXmlPath --resources $resourcesDir $newPackagePath}
Start-NativeExecution -sb {productbuild --distribution $distributionXmlPath --resources $resourcesDir $newPackagePath} -VerboseOutputOnError
}
finally
{
@@ -960,7 +960,7 @@ function New-MacOsDistributionPackage
Remove-item -Path $tempDir -Recurse -Force
}
return $newPackagePath
return (Get-Item $newPackagePath)
}
function Get-FpmArguments
{
@@ -2246,7 +2246,7 @@ function New-NugetContentPackage
$nupkgFile = "${nugetFolder}\${nuspecPackageName}-${packageRuntime}.${nugetSemanticVersion}.nupkg"
if (Test-Path $nupkgFile)
{
Get-ChildItem $nugetFolder\* | Select-Object -ExpandProperty FullName
Get-Item $nupkgFile
}
else
{
+30 -2
View File
@@ -359,6 +359,15 @@ elseif($Stage -eq 'Build')
$packages = @(Start-PSPackage @packageParams -SkipReleaseChecks)
foreach($package in $packages)
{
if (Test-Path $package)
{
Write-Log "Package found: $package"
}
else
{
Write-Error -Message "Package NOT found: $package"
}
# Publish the packages to the nuget feed if:
# 1 - It's a Daily build (already checked, for not a PR)
# 2 - We have the info to publish (NUGET_KEY and NUGET_URL)
@@ -368,17 +377,36 @@ elseif($Stage -eq 'Build')
Write-Log "pushing $package to $env:NUGET_URL"
Start-NativeExecution -sb {dotnet nuget push $package --api-key $NugetKey --source "$env:NUGET_URL/api/v2/package"} -IgnoreExitcode
}
if($isDailyBuild)
{
if ($package -isnot [System.IO.FileInfo])
{
$packageObj = Get-Item $package
Write-Error -Message "The PACKAGE is not a FileInfo object"
}
else
{
$packageObj = $package
}
Write-Log -message "Artifacts directory: ${env:BUILD_ARTIFACTSTAGINGDIRECTORY}"
Copy-Item $packageObj.FullName -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force
}
}
if ($IsLinux)
{
# Create and package Raspbian .tgz
Start-PSBuild -PSModuleRestore -Clean -Runtime linux-arm -Configuration 'Release'
Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
$armPackage = Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
Copy-Item $armPackage -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force
}
if ($isDailyBuild)
{
New-TestPackage -Destination $pwd
New-TestPackage -Destination "${env:SYSTEM_ARTIFACTSDIRECTORY}"
}
}