-
Notifications
You must be signed in to change notification settings - Fork 20
/
Deploy.ps1
31 lines (25 loc) · 852 Bytes
/
Deploy.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
[CmdletBinding()]
param (
[Parameter(Mandatory=$True, HelpMessage="The NuGet API Key.")]
[string] $ApiKey,
[Parameter(Mandatory=$True, HelpMessage="The NuGet API Key.")]
[string] $PackageVersion
)
$assemblyName = "Donald"
$assemblyPath = Join-Path -Path $PSScriptRoot -ChildPath "src\$assemblyName\"
$nugetPath = Join-Path -Path $assemblyPath -ChildPath "bin\Release\$assemblyName.$PackageVersion.nupkg"
if(!(Test-Path -Path $assemblyPath))
{
throw "Invalid project"
}
function RunCommand {
param ([string] $CommandExpr)
Write-Verbose " $CommandExpr"
Invoke-Expression $CommandExpr
}
#
# Pack
RunCommand -CommandExpr "dotnet pack $assemblyPath -c Release --include-symbols --nologo --verbosity quiet"
#
# Publish
RunCommand -CommandExpr "dotnet nuget push $nugetPath -k `"$ApiKey`" -s https://api.nuget.org/v3/index.json"