Skip to content

Commit 14cf15d

Browse files
committed
Add NuGet package/publish to build script
1 parent d42a99b commit 14cf15d

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ _ReSharper*/
3030
packages/
3131
*.userprefs
3232
*.nupkg
33-
.fake/
33+
.fake/
34+
dist/

build.fsx

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#r @"packages/FAKE.4.21.0/tools/NuGet.Core.dll"
22
#r @"packages/FAKE.4.21.0/tools/FakeLib.dll"
33

4+
open System.IO
5+
open System.Linq
46
open Fake
57

68
let exec command args =
@@ -9,15 +11,30 @@ let exec command args =
911
if result <> 0 then failwithf "%s exited with error %d" command result
1012

1113
Target "restore" (fun () ->
12-
exec "tools/NuGet.exe" "restore QuickLayout.sln"
14+
exec "tools/nuget.exe" "restore QuickLayout.sln"
1315
)
1416

1517
Target "build" (fun () ->
16-
MSBuild null "Build" [ "Configuration", "Debug" ] [ "QuickLayout.sln" ]
18+
MSBuild null "Build" [ "Configuration", "Release" ] [ "QuickLayout.sln" ]
1719
|> ignore
1820
)
1921

20-
"restore"
21-
==> "build"
22+
Target "nuget-package" (fun () ->
23+
if Directory.Exists("dist") then Directory.Delete("dist", true)
24+
Directory.CreateDirectory("dist") |> ignore
25+
26+
exec "tools/nuget.exe" "pack nuspec/Cirrious.FluentLayout.nuspec -NoDefaultExcludes -OutputDirectory dist"
27+
)
28+
29+
Target "nuget-push" (fun () ->
30+
let nupkgPath = Directory.EnumerateFiles("dist", "*.nupkg").First()
31+
32+
exec "tools/nuget.exe" ("push " + nupkgPath)
33+
)
34+
35+
"restore"
36+
==> "build"
37+
==> "nuget-package"
38+
==> "nuget-push"
2239

2340
RunTarget()

nuspec/nuget.exe

-1.59 MB
Binary file not shown.

0 commit comments

Comments
 (0)