forked from mavnn/NuGetPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PackNGP.fsx
30 lines (27 loc) · 1.1 KB
/
PackNGP.fsx
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
#r "./tools/fake/fakelib.dll"
open Fake
open System.IO
open System.Text.RegularExpressions
let packExe () =
let tools = environVar "tools"
let versionRegex = Regex(@"AssemblyInformationalVersion\(\""(?<version>.*)\""\)")
let version =
ReadFileAsString ("NuGetPlus.Console" @@ "AssemblyInfo.fs")
|> versionRegex.Match
|> (fun m -> m.Groups.["version"].Value)
let setNugetParams param =
{ param with
Version = version
Project = "NuGetPlus"
OutputPath = "." @@ "output"
WorkingDir = "."
ToolPath = tools @@ "NuGet" @@ "NuGet.exe"
AccessKey = environVarOrDefault "apikey" ""
PublishUrl = environVarOrDefault "pushurl" ""
NoPackageAnalysis = true
Publish = not isLocalBuild }
NuGetPack setNugetParams ("NuGetPlus.Console" @@ "ngp.nuspec")
if not isLocalBuild then
NuGetPublish setNugetParams
let Default = Target "Default" packExe
RunParameterTargetOrDefault "Target" "Default"