From 95f845b69115f2d4227fc60d32d345030a36c80b Mon Sep 17 00:00:00 2001 From: "Kirk Shoop (MS OPEN TECH)" Date: Fri, 29 Aug 2014 10:45:54 -0700 Subject: [PATCH] add script to push nupkgs --- msvs/setups/CreatePackages.ps1 | 3 ++- msvs/setups/PushPackages.ps1 | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 msvs/setups/PushPackages.ps1 diff --git a/msvs/setups/CreatePackages.ps1 b/msvs/setups/CreatePackages.ps1 index 65585828..9baab1ad 100644 --- a/msvs/setups/CreatePackages.ps1 +++ b/msvs/setups/CreatePackages.ps1 @@ -21,4 +21,5 @@ Copy-Item *.nupkg ..\packages\NuGet Set-Location $CurDir -Write-Host "The .nuspec files are in the 'packages' directory" -foregroundcolor black -backgroundcolor green +Write-Host "The .nupkg files are in the 'packages' directory." -foregroundcolor black -backgroundcolor green +Write-Host "Run PushPackages to push them." -foregroundcolor red -backgroundcolor yellow diff --git a/msvs/setups/PushPackages.ps1 b/msvs/setups/PushPackages.ps1 new file mode 100644 index 00000000..e61f8f54 --- /dev/null +++ b/msvs/setups/PushPackages.ps1 @@ -0,0 +1,25 @@ +param ( + [string] $Version = $(throw 'Redis version to push is required') +) + +Write-Host "Ensure that the api keys have been set for chocolatey and nuget" -foregroundcolor red -backgroundcolor yellow +Write-Host " NuGet SetApiKey -source http://chocolatey.org/" -foregroundcolor red -backgroundcolor yellow +Write-Host " NuGet SetApiKey " -foregroundcolor red -backgroundcolor yellow + +$CurDir = split-path -parent $MyInvocation.MyCommand.Definition + +$PackagesDir = $CurDir + "\packages" +$ChocolateyDir = $PackagesDir + "\Chocolatey" +$NugetDir = $PackagesDir + "\Nuget" + +Set-Location $ChocolateyDir +$ChocolateyCommand = "chocolatey push Redis-64." + $Version + ".nupkg" +invoke-expression $ChocolateyCommand + +Set-Location $NugetDir +$NugetCommand = "NuGet push Redis-64." + $Version + ".nupkg" +invoke-expression $NugetCommand + +Set-Location $CurDir + +Write-Host "The .nupkg files have been pushed!" -foregroundcolor black -backgroundcolor green