add after build script example that shows how to automatically upload packages to myget which is useful for automated builds

This commit is contained in:
Peter Rekdal Sunde
2014-10-14 10:58:16 +02:00
parent 4c7e4a6b21
commit bd56578df0
2 changed files with 39 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
param(
[Parameter(Position = 0, Mandatory = $true)]
[string] $Version
)
$WorkingDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$Nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe
$PackagePath = Join-Path $WorkingDir\nuget
function Write-Diagnostic
{
param(
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
[string] $Message
)
Write-Host
Write-Host $Message -ForegroundColor Green
Write-Host
}
Write-Diagnostic "Uploading packages to myget"
$Packages = @(
"$PackagePath\CefSharp.Common.$Version.nupkg",
"$PackagePath\CefSharp.WinForms.$Version.nupkg",
"$PackagePath\CefSharp.Wpf.$Version.nupkg"
)
$Packages | ForEach-Object {
. $Nuget push $_ -Source https://myget.org/F/X
}
+7
View File
@@ -222,6 +222,13 @@ function Nupkg
. $nuget pack nuget\CefSharp.Common.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget -Properties "RedistVersion=$RedistVersion"
. $nuget pack nuget\CefSharp.Wpf.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
. $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
# Invoke `AfterBuild` script if available (ie. upload packages to myget)
if(-not (Test-Path $WorkingDir\AfterBuild.ps1)) {
return
}
. $WorkingDir\AfterBuild.ps1 -Version $Version
}
function DownloadNuget()