2017-02-10 15:57:20 +00:00
|
|
|
param([switch]$nopush)
|
2017-02-10 15:55:16 +00:00
|
|
|
|
2017-02-08 21:09:06 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
function pack
|
|
|
|
{
|
|
|
|
param([string]$project)
|
2017-02-08 21:09:06 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
Write-Host "Packing $($project).csproj" -Foreground Blue
|
|
|
|
NuGet.exe pack "$($project)\$($project).csproj" -Build -OutputDir publish -Version "$($version.NuGetVersion)" -Properties depversion="$($version.NuGetVersion)"
|
|
|
|
}
|
2017-02-08 21:09:06 +00:00
|
|
|
|
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
function push
|
|
|
|
{
|
|
|
|
param([string]$project)
|
2017-02-08 21:09:06 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
Write-Host "Pushing $($project).csproj" -Foreground Blue
|
2017-02-14 22:21:43 +00:00
|
|
|
NuGet.exe push "publish\$($project).$($version.NuGetVersion).nupkg" -apikey "$($nugetkey)" -Source https://www.nuget.org/api/v2/package
|
2017-02-12 21:00:08 +00:00
|
|
|
}
|
2017-02-10 15:33:05 +00:00
|
|
|
|
2017-02-08 21:09:06 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
$projects = @(
|
|
|
|
"Tapeti.Annotations",
|
|
|
|
"Tapeti",
|
|
|
|
"Tapeti.DataAnnotations",
|
|
|
|
"Tapeti.Flow",
|
|
|
|
"Tapeti.SimpleInjector"
|
|
|
|
)
|
2017-02-08 21:09:06 +00:00
|
|
|
|
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
New-Item -Path publish -Type directory -Force | Out-Null
|
2017-02-08 21:09:06 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
$version = GitVersion.exe | Out-String | ConvertFrom-Json
|
|
|
|
$nugetkey = Get-Content .nuget.apikey
|
|
|
|
|
|
|
|
|
|
|
|
Write-Host "Publishing version $($version.NuGetVersion) using API key $($nugetkey)"-Foreground Cyan
|
2017-02-10 15:33:05 +00:00
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
foreach ($project in $projects)
|
|
|
|
{
|
|
|
|
pack($project)
|
|
|
|
}
|
2017-02-08 21:09:06 +00:00
|
|
|
|
|
|
|
|
2017-02-12 21:00:08 +00:00
|
|
|
if ($nopush -eq $false)
|
|
|
|
{
|
|
|
|
foreach ($project in $projects)
|
|
|
|
{
|
|
|
|
push($project)
|
|
|
|
}
|
2017-02-10 15:55:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host "Skipping push" -Foreground Blue
|
|
|
|
}
|