From 159dcee626e2af3eccbefdae63f299ee52d30c0d Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Thu, 19 May 2016 19:03:43 -0700 Subject: [PATCH 1/3] Add Publish-NuGetFeed function to build.psm1 --- .gitignore | 3 +++ appveyor.yml | 14 +++++++++----- build.psm1 | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b354858e8..28e998ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ install.ps1 # ignore the version file as it is generated at build time powershell.version + +# default location for produced nuget packages +/nuget-artifacts diff --git a/appveyor.yml b/appveyor.yml index 6413799cf..3b35f8ec6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,6 @@ install: build_script: - ps: | $ErrorActionPreference = 'Stop' - Import-Module .\build.psm1 Start-PSBuild -Publish Start-PSBuild -FullCLR @@ -73,12 +72,17 @@ on_finish: [System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath) [System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath) - @( - # You can add other artifacts here + $artifacts = @( $zipFilePath, $zipFileFullPath - ) | % { - Write-Host "Pushing package $_ as Appveyor artifact" + ) + + Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix $env:APPVEYOR_BUILD_NUMBER + + $artifacts += (ls .\nuget-artifacts | % {$_.FullName}) + + $artifacts | % { + Write-Host "Pushing $_ as Appveyor artifact" Push-AppveyorArtifact $_ } } catch { diff --git a/build.psm1 b/build.psm1 index a51fbea77..2061eb7c6 100644 --- a/build.psm1 +++ b/build.psm1 @@ -529,6 +529,34 @@ Built upon .NET Core, it is also a C# REPL. } } +function Publish-NuGetFeed +{ + param( + [string]$OutputPath = "$PSScriptRoot/nuget-artifacts", + [Parameter(Mandatory=$true)] + [string]$VersionSuffix + ) + + @( +'Microsoft.Management.Infrastructure', +'Microsoft.PowerShell.Commands.Management', +'Microsoft.PowerShell.Commands.Utility', +'Microsoft.PowerShell.ConsoleHost', +'Microsoft.PowerShell.PSReadLine', +'Microsoft.PowerShell.Security', +'System.Management.Automation' + ) | % { + if ($VersionSuffix) + { + dotnet pack "src/$_" --output $OutputPath --version-suffix $VersionSuffix + } + else + { + dotnet pack "src/$_" --output $OutputPath + } + } +} + function Start-DevPSGitHub { param( From 6259d1ca4ea3da40cbc8853cd40f7e5828083f73 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Thu, 19 May 2016 20:56:48 -0700 Subject: [PATCH 2/3] Enable project_feed in appveyor.yml --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3b35f8ec6..caf25e771 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,7 @@ -image: Visual Studio 2015 +version: 0.4.0.{build} -version: 0.2.0.{build} +nuget: + project_feed: true environment: priv_key: From 45f56386766c8c7dacf8bd6adb4c1541c8aa6189 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Sun, 22 May 2016 00:43:36 -0700 Subject: [PATCH 3/3] Fix VersionSuffix in nuget packaging from appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index caf25e771..1e59ed7ce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -78,7 +78,7 @@ on_finish: $zipFileFullPath ) - Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix $env:APPVEYOR_BUILD_NUMBER + Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix "b$($env:APPVEYOR_BUILD_NUMBER)" $artifacts += (ls .\nuget-artifacts | % {$_.FullName})