-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.ps1
32 lines (28 loc) · 1.14 KB
/
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
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 }
if($env:APPVEYOR_REPO_TAG_NAME -eq $NULL)
{
# $revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]
# $suffix = "dev{0:D4}" -f [convert]::ToInt32($revision, 10)
# echo "build: Development build - no commit tag. Package version suffix is $suffix"
echo "build: Development build - commit tag not detected"
exec { & dotnet pack .\FFMediaToolkit\FFMediaToolkit.csproj -c Debug /p:ContinuousIntegrationBuild=true -o .\artifacts --include-symbols }
# --version-suffix=$suffix
}
else
{
echo "build: Release build - tagged commit detected."
exec { & dotnet pack .\FFMediaToolkit\FFMediaToolkit.csproj -c Release /p:ContinuousIntegrationBuild=true -o .\artifacts --include-symbols }
}