-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuget-push.ps1
More file actions
28 lines (21 loc) · 843 Bytes
/
nuget-push.ps1
File metadata and controls
28 lines (21 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<#
Default value for nuget source in local development is c:\local-nuget
Default value can be changed with following command
Usage example: nuget-push.ps1 -Source d:\local-nuget
TFS CI should supply following variables: SourceDEV, SourcePROD and ApiKey
#>
param([String] $Source = "c:\local-nuget", [String] $SourceDEV, [String] $SourcePROD, [String] $ApiKey)
Push-Location $PSScriptRoot\artifacts
if ($env:BUILD_SOURCEBRANCHNAME -eq "dev"){
$Source = $SourceDEV }
elseif ($env:BUILD_SOURCEBRANCHNAME -eq "master"){
$Source = $SourcePROD }
foreach ($nupkg in ls *.nupkg| Where-Object {$_.Name -notlike "*symbols*"} )
{
"`n"
Write-Debug "Package $($nupkg.Name) is ready to push"
"`n"
nuget push $nupkg -ApiKey ($ApiKey,"no key")[$ApiKey -ne $NULL] -Source $Source
"`n"
Write-Debug "Pushed $($nupkg.Name)"
}