-
Notifications
You must be signed in to change notification settings - Fork 0
/
Push-Packages.ps1
33 lines (27 loc) · 1.1 KB
/
Push-Packages.ps1
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
29
30
31
32
33
# Push all packages from release builds to Tigra Astronomy MyGet feed.
# Assumes that the API key for the relevant feeds has been installed in NuGet.
# Searches the current directory and child directories recursively.
param (
[string]$ApiKey = $null
)
if ($ApiKey) { $setApiKey = "-ApiKey " + $ApiKey }
$packageFeed = "https://www.myget.org/F/tigra-astronomy/api/v2/package"
$symbolFeed = "https://www.myget.org/F/tigra-astronomy/api/v3/index.json"
$allPackages = Get-ChildItem -Recurse | Where-Object { $_.Name -match '^.*\.s?nupkg$' }
$releasePackages = $allPackages | Where-Object { $_.DirectoryName -match 'Release' }
if ($releasePackages) {
$releasePackages | Format-Table | Write-Output
}
else {
Write-Host "No release packages found"
Exit
}
foreach ($package in $releasePackages) {
if ($package.Name -like "*.snupkg") {
#Symbols are supposed to be pushed alongside their related packacge, so no need for a separate push.
#NuGet.exe push -Source $symbolFeed $package $setApiKey
}
else {
NuGet.exe push -SkipDuplicate -Source $packageFeed $package $setApiKey
}
}