forked from rasmuskl/Catapult
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
73 lines (60 loc) · 4.94 KB
/
build.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
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
70
71
72
73
#r "tools/FAKE/tools/FakeLib.dll"
open Fake
open System
open Fake.AssemblyInfoFile
let artifactsDir = "./artifacts/"
let publishBuildDir = artifactsDir + "publish-build/"
let buildNumber = environVarOrDefault "BUILD_BUILDNUMBER" "0.2.11"
let storageUrl = "https://github.com/rasmuskl/Catapult"
setBuildParam "MSBuild" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
Target "Clean" (fun _ ->
CleanDirs [ artifactsDir ]
)
Target "Version" (fun _ ->
CreateCSharpAssemblyInfo "./Source/Catapult.App/Properties/AssemblyInfo.cs"
[Attribute.Title "Catapult"
Attribute.Description "Catapult Launcher"
Attribute.Guid "1c2e3e46-7e39-4c03-8816-ea2791fa184d"
Attribute.Product "Catapult"
Attribute.Version buildNumber
Attribute.FileVersion buildNumber
Attribute.Metadata("SquirrelAwareVersion", "1")]
CreateCSharpAssemblyInfo "./Source/Catapult.Core/Properties/AssemblyInfo.cs"
[Attribute.Title "Catapult.Core"
Attribute.Guid "a33d57d2-0a7f-4901-beab-a92382a033eb"
Attribute.Product "Catapult"
Attribute.Version buildNumber
Attribute.FileVersion buildNumber]
)
Target "Build" (fun _ ->
MSBuildReleaseExt publishBuildDir List.empty "Build" ["Source/Catapult.sln"]
|> Log "AppBuild-Output: "
)
Target "Package" (fun _ ->
CreateDir (artifactsDir + "package/")
NuGetPackDirectly (fun p ->
{p with
Version = buildNumber
OutputPath = artifactsDir + "package/"
WorkingDir = artifactsDir + "package/"})
"./Catapult.nuspec"
)
Target "SyncReleases" (fun _ ->
let result = ExecProcess (fun x ->
x.FileName <- "tools/squirrel.windows/tools/SyncReleases.exe"
x.Arguments <- "-u " + storageUrl + " -r " + "./artifacts/releases") (TimeSpan.FromMinutes 5.0)
if result <> 0 then failwith "Failed result from SyncReleases"
)
Target "Releasify" (fun _ ->
let result = ExecProcess (fun x ->
x.FileName <- "tools/squirrel.windows/tools/squirrel.com"
x.Arguments <- "--releasify=" + "./artifacts/package/Catapult."+buildNumber+".nupkg" + " -releaseDir=" + "./artifacts/releases") (TimeSpan.FromMinutes 5.0)
if result <> 0 then failwith "Failed result from squirrel --releasify"
)
"Clean"
==> "Version"
==> "Build"
==> "Package"
==> "SyncReleases"
==> "Releasify"
Run "Releasify"