-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuget-publish-all.ps1
32 lines (25 loc) · 1.06 KB
/
nuget-publish-all.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
. .\common-manifest.ps1
. .\common-projects.ps1
. .\common-nuget.ps1
function Publish-Projects-All {
[string[]]$csprojFiles = (Get-AllProjectFiles)
[string]$apiKey = (Get-NuGetApiKey)
[string]$sourceUrl = (Get-NuGetSourceUrl)
[string]$version = (Get-CurrentVersion)
[string]$currentWorkingDir = (Get-Location)
if (($apiKey -eq $null) -or ($apiKey -like '')) {
Write-Host "NuGet api key not set. Run ./nuget-setup.ps1 to configure NuGet publishing" -ForegroundColor Red
return
}
if (($sourceUrl -eq $null) -or ($sourceUrl -like '')) {
Write-Host "NuGet source URL not set. Run ./nuget-setup.ps1 to configure NuGet publishing" -ForegroundColor Red
return
}
Foreach ($csprojFile in $csprojFiles) {
[string]$projectName = (Get-ProjectName -csprojFile $csprojFile)
Set-Location $currentWorkingDir
Publish-Project -projectName $projectName -configuration "Release" -packageVersion $version -apiKey $apiKey -sourceUrl $sourceUrl
}
Write-Host ("Done publishing NuGet packages") -ForegroundColor DarkGreen
}
Publish-Projects-All