-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
36 lines (24 loc) · 880 Bytes
/
build.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
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, HelpMessage = "version for package")]
[string] $version,
[Parameter(HelpMessage = "api key (if publising nuget packages)")]
[string] $api,
[Parameter(HelpMessage = "test only")]
[switch] $skipBuild
)
if (-not $skipBuild) {
#force rebuild
Get-ChildItem -r bin | Remove-Item -r
Get-ChildItem -r obj | Remove-Item -r
dotnet build -c Release
Get-ChildItem -r *.nupkg | Remove-Item -r
#make nuget packages
dotnet pack -p:PackageVersion=$version .\JPoke\JPoke.csproj
#remove pdbs
get-ChildItem -recurse -path .\publish\ -include *.pdb | remove-item
}
if (-not ($api -like '') ) {
dotnet nuget push .\JPoke\bin\Release\JPoke.$($version).nupkg --api-key $api --source https://api.nuget.org/v3/index.json
}
get-ChildItem -r *.nupkg | % FullName