forked from fsprojects/FSharp.Control.Reactive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
22 lines (19 loc) · 852 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
[xml]$doc = Get-Content .\src\Directory.Build.props
$version = $doc.Project.PropertyGroup.VersionPrefix # the version under development, update after a release
$versionSuffix = '-build.0' # manually incremented for local builds
function isVersionTag($tag){
$v = New-Object Version
[Version]::TryParse($tag, [ref]$v)
}
if ($env:appveyor){
$versionSuffix = '-build.' + $env:appveyor_build_number
if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
$version = $env:appveyor_repo_tag_name
$versionSuffix = ''
}
Update-AppveyorBuild -Version "$version$versionSuffix"
}
dotnet tool restore
dotnet build -c Release /p:Version=$version$versionSuffix
dotnet test --no-build -c Release tests
dotnet pack --no-restore -c Release /p:Version=$version$versionSuffix -o $psscriptroot/bin