forked from fslaborg/FsMath
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackageTasks.fs
More file actions
69 lines (62 loc) · 2.46 KB
/
PackageTasks.fs
File metadata and controls
69 lines (62 loc) · 2.46 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module PackageTasks
open ProjectInfo
open MessagePrompts
open BasicTasks
open TestTasks
open BlackFox.Fake
open Fake.Core
open Fake.DotNet
open Fake.IO.Globbing.Operators
open System.Text.RegularExpressions
/// https://github.com/Freymaurer/Fake.Extensions.Release#release-notes-in-nuget
let private replaceCommitLink input =
let commitLinkPattern = @"\[\[#[a-z0-9]*\]\(.*\)\] "
Regex.Replace(input,commitLinkPattern,"")
let pack = BuildTask.create "Pack" [clean; buildSolution; runTests] {
if promptYesNo (sprintf "creating stable package with version %s OK?" stableVersionTag )
then
!! "src/**/*.*proj"
-- "src/bin/*"
|> Seq.iter (Fake.DotNet.DotNet.pack (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"Version",stableVersionTag
"PackageReleaseNotes", (release.Notes |> List.map replaceCommitLink |> String.concat "\r\n" )
] @ p.MSBuildParams.Properties)
DisableInternalBinLog = true
}
{
p with
MSBuildParams = msBuildParams
OutputPath = Some pkgDir
}
|> DotNet.Options.withCustomParams (Some "-tl")
))
else failwith "aborted"
}
let packPrerelease = BuildTask.create "PackPrerelease" [setPrereleaseTag; clean; buildSolution; runTests] {
if promptYesNo (sprintf "package tag will be %s OK?" prereleaseTag )
then
!! "src/**/*.*proj"
-- "src/bin/*"
|> Seq.iter (Fake.DotNet.DotNet.pack (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"Version", prereleaseTag
"PackageReleaseNotes", (release.Notes |> List.map replaceCommitLink |> String.toLines )
] @ p.MSBuildParams.Properties)
DisableInternalBinLog = true
}
{
p with
VersionSuffix = Some prereleaseSuffix
OutputPath = Some pkgDir
MSBuildParams = msBuildParams
}
|> DotNet.Options.withCustomParams (Some "-tl")
))
else
failwith "aborted"
}