From 8919564e87e96997d544f8304b6b09388b0fd8ac Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 2 Apr 2019 17:13:57 -0700 Subject: [PATCH 1/2] Publish the daily nupkg package to MyGet --- build.psm1 | 46 ---------------------------------------------- tools/ci.psm1 | 9 ++++++--- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/build.psm1 b/build.psm1 index ad1acb3cec9..17080cbc6f6 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1745,52 +1745,6 @@ function Start-PSBootstrap { } } -function Publish-NuGetFeed -{ - param( - [string]$OutputPath = "$PSScriptRoot/nuget-artifacts", - [ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")] - [ValidateNotNullOrEmpty()] - [string]$ReleaseTag - ) - - # Add .NET CLI tools to PATH - Find-Dotnet - - ## We update 'project.assets.json' files with new version tag value by 'GetPSCoreVersionFromGit' target. - $TopProject = (New-PSOptions).Top - if ($ReleaseTag) { - $ReleaseTagToUse = $ReleaseTag -Replace '^v' - dotnet restore $TopProject "/property:ReleaseTag=$ReleaseTagToUse" - } else { - dotnet restore $TopProject - } - - try { - Push-Location $PSScriptRoot - @( -'Microsoft.PowerShell.Commands.Management', -'Microsoft.PowerShell.Commands.Utility', -'Microsoft.PowerShell.Commands.Diagnostics', -'Microsoft.PowerShell.ConsoleHost', -'Microsoft.PowerShell.Security', -'System.Management.Automation', -'Microsoft.PowerShell.CoreCLR.Eventing', -'Microsoft.WSMan.Management', -'Microsoft.WSMan.Runtime', -'Microsoft.PowerShell.SDK' - ) | ForEach-Object { - if ($ReleaseTag) { - dotnet pack "src/$_" --output $OutputPath "/property:IncludeSymbols=true;ReleaseTag=$ReleaseTagToUse" - } else { - dotnet pack "src/$_" --output $OutputPath - } - } - } finally { - Pop-Location - } -} - function Start-DevPowerShell { [CmdletBinding(DefaultParameterSetName='ConfigurationParamSet')] param( diff --git a/tools/ci.psm1 b/tools/ci.psm1 index e40a0cf3827..280c8bf40d6 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -505,11 +505,10 @@ function Invoke-CIFinish # only publish assembly nuget packages if it is a daily build and tests passed if(Test-DailyBuild) { - Publish-NuGetFeed -OutputPath .\nuget-artifacts -ReleaseTag $preReleaseVersion - $nugetArtifacts = Get-ChildItem .\nuget-artifacts -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName } + $nugetArtifacts = Get-ChildItem $PSScriptRoot\packaging\nugetOutput -ErrorAction SilentlyContinue -Filter *.nupkg | Select-Object -ExpandProperty FullName if($nugetArtifacts) { - $artifacts.AddRange($nugetArtifacts) + $artifacts.AddRange(@($nugetArtifacts)) } } @@ -523,6 +522,7 @@ function Invoke-CIFinish $artifacts.Add($arm64Package) $pushedAllArtifacts = $true + $artifacts | ForEach-Object { Write-Log -Message "Pushing $_ as CI artifact" if(Test-Path $_) @@ -535,6 +535,9 @@ function Invoke-CIFinish Write-Warning "Artifact $_ does not exist." } + Write-Verbose -verbose "NuGetURL == $env:NUGET_URL" + Write-Verbose -Verbose "Nuget key: $NuGetKey" + if($NuGetKey -and $env:NUGET_URL -and [system.io.path]::GetExtension($_) -ieq '.nupkg') { Write-Log "pushing $_ to $env:NUGET_URL" From cf04a5da7e5fcf5b0a222b7e15171cb4a88c0385 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 3 Apr 2019 12:15:25 -0700 Subject: [PATCH 2/2] Removed debug statements --- tools/ci.psm1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 280c8bf40d6..ab3e3dbd731 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -535,9 +535,6 @@ function Invoke-CIFinish Write-Warning "Artifact $_ does not exist." } - Write-Verbose -verbose "NuGetURL == $env:NUGET_URL" - Write-Verbose -Verbose "Nuget key: $NuGetKey" - if($NuGetKey -and $env:NUGET_URL -and [system.io.path]::GetExtension($_) -ieq '.nupkg') { Write-Log "pushing $_ to $env:NUGET_URL"