-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBuild.ps1
More file actions
23 lines (18 loc) · 831 Bytes
/
Build.ps1
File metadata and controls
23 lines (18 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function Exec
{
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
)
& $cmd
if ($lastexitcode -ne 0) {
throw ("Exec: " + $errorMessage)
}
}
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
exec { & dotnet restore }
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$revision = [convert]::ToInt32($revision, 10)
exec { & dotnet pack .\src\Sino.JobExecutor -c Release -o .\artifacts --version-suffix=$revision }
exec { & dotnet nuget push .\src\Sino.JobExecutor\artifacts\*.nupkg -k oy2ldo4cgyv5lpfkc7caa3rgnogctf7epa2m3urthba5ni -s https://api.nuget.org/v3/index.json }