-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreateNuGetPackage.ps1
41 lines (32 loc) · 1.05 KB
/
createNuGetPackage.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
34
35
36
37
38
39
40
41
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[Alias('a')]
[ValidateSet('pack')]
[string]$action = "pack",
[Parameter(Mandatory=$false)]
[string]$packageVersion = "0.4.1",
[Parameter(Mandatory=$false)]
[string]$configuration = "Release"
)
<#
https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-pack
#>
cd "C:\DVT\DynamicSugarNet"
if($configuration.ToLowerInvariant() -eq "debug") {
$packageVersion = "$packageVersion-debug"
}
cls
Write-Output "Create NuGet Package - version:$packageVersion, configuration:$configuration"
$NUGET_OUTPUT_FOLDER = "bin\$Configuration\nuGet\"
$PACKAGE_FILE = "$NUGET_OUTPUT_FOLDER\DynamicSugar2.$packageVersion.nupkg"
if(Test-Path $PACKAGE_FILE) {
Remove-Item $PACKAGE_FILE
}
& .\NuGet.exe pack .\Package.nuspec -Version $packageVersion -Properties Configuration=$Configuration -OutputDirectory "$NUGET_OUTPUT_FOLDER"
<#
https://learn.microsoft.com/en-us/nuget/reference/nuspec
upload
https://www.nuget.org/packages/DynamicSugar2
fredericaltorres@live.com
#>