1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Publish.ps1

55 lines
1.1 KiB
PowerShell
Raw Normal View History

2017-02-10 15:57:20 +00:00
param([switch]$nopush)
2017-02-08 21:09:06 +00:00
function pack
{
param([string]$project)
2017-02-08 21:09:06 +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
function push
{
param([string]$project)
2017-02-08 21:09:06 +00:00
Write-Host "Pushing $($project).csproj" -Foreground Blue
NuGet.exe push "publish\$($project).$($version.NuGetVersion).nupkg" -apikey "$($nugetkey)" -Source https://www.nuget.org/api/v2/package
}
2017-02-08 21:09:06 +00:00
$projects = @(
"Tapeti.Annotations",
"Tapeti",
"Tapeti.DataAnnotations",
"Tapeti.Flow",
"Tapeti.SimpleInjector"
)
2017-02-08 21:09:06 +00:00
New-Item -Path publish -Type directory -Force | Out-Null
2017-02-08 21:09:06 +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
foreach ($project in $projects)
{
pack($project)
}
2017-02-08 21:09:06 +00:00
if ($nopush -eq $false)
{
foreach ($project in $projects)
{
push($project)
}
}
else
{
Write-Host "Skipping push" -Foreground Blue
}