forked from fsharp/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.ps1
31 lines (24 loc) · 1.02 KB
/
appveyor.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
# the version under development, update after a release
$version = '4.1.0.2'
function isVersionTag($tag){
$v = New-Object Version
[Version]::TryParse(($tag).Replace('-alpha','').Replace('-beta',''), [ref]$v)
}
# append the AppVeyor build number as the pre-release version
if ($env:appveyor){
$version = $version + '-b' + [int]::Parse($env:appveyor_build_number).ToString('000')
if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
$version = $env:appveyor_repo_tag_name
}
Update-AppveyorBuild -Version $version
} else {
$version = $version + '-b001'
}
$nuget = (gi .\.nuget\NuGet.exe).FullName
$packagesOutDir = Join-Path $PSScriptRoot "lib\release\"
function pack($nuspec){
$dir = [IO.Path]::GetDirectoryName($nuspec)
& $nuget pack $nuspec -BasePath "$dir" -Version $version -OutputDirectory "$packagesOutDir" -NoDefaultExcludes -Verbosity d
}
pack(gi .\FSharp.Core.Nuget\FSharp.Core.nuspec)
pack(gi .\FSharp.Compiler.Tools.Nuget\FSharp.Compiler.Tools.nuspec)