Skip to content

Commit 43d863d

Browse files
author
Don Syme
committed
update build scripts
1 parent 0c4aae8 commit 43d863d

4 files changed

Lines changed: 23 additions & 47 deletions

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10-
- name: Setup .NET
10+
- name: Setup .NET
1111
uses: actions/setup-dotnet@v1
1212
with:
1313
dotnet-version: '3.1.x'
14-
- name: Setup .NET
14+
- name: Setup .NET
1515
uses: actions/setup-dotnet@v1
1616
with:
1717
dotnet-version: '5.0.202'
1818
- name: Install tools
1919
run: dotnet tool restore
20-
- name: Build and Test and Docs using FAKE
20+
- name: Build and Test and Docs using FAKE
2121
run: dotnet fake build
2222
- name: Deploy
2323
uses: peaceiris/actions-gh-pages@v3
@@ -26,3 +26,11 @@ jobs:
2626
publish_dir: ./output
2727
publish_branch: gh-pages
2828
force_orphan: true
29+
- name: Examine bin
30+
run: ls -r bin
31+
- name: Publish NuGets (if this version not published before)
32+
run: dotnet nuget push bin\FSharp.Core.Fluent.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN_2021 }} --skip-duplicate
33+
34+
# NUGET_ORG_TOKEN_2021 is listed in "Repository secrets" in https://github.com/fsprojects/FSharp.Core.Fluent/settings/secrets/actions
35+
# note, the nuget org token expires around 24 July 2022
36+

build.fsx

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ open System.IO
3232
// (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src')
3333
let project = "src/FSharp.Control.AsyncSeq"
3434

35-
// File system information
35+
// File system information
3636
let solutionFile = "FSharp.Control.AsyncSeq.sln"
3737

3838
let summary = "Asynchronous sequences for F#"
@@ -97,7 +97,7 @@ Target.create "Build" (fun _ ->
9797
// --------------------------------------------------------------------------------------
9898
// Run the unit tests using test runner
9999

100-
Target.create "RunTests" (fun _ ->
100+
Target.create "Test" (fun _ ->
101101
solutionFile
102102
|> DotNet.test (fun opts ->
103103
{ opts with
@@ -112,13 +112,13 @@ Target.create "RunTests" (fun _ ->
112112
// --------------------------------------------------------------------------------------
113113
// Build a NuGet package
114114

115-
Target.create "NuGet" (fun _ ->
116-
115+
Target.create "Pack" (fun _ ->
116+
117117
File.WriteAllText("version.props",versionPropsTemplate)
118118
DotNet.pack (fun pack ->
119119
{ pack with
120-
OutputPath = Some artifactsDir
121-
Configuration = configuration
120+
OutputPath = Some artifactsDir
121+
Configuration = configuration
122122
}) solutionFile
123123
)
124124

@@ -127,34 +127,7 @@ Target.create "NuGet" (fun _ ->
127127

128128
Target.create "GenerateDocs" (fun _ ->
129129
Shell.cleanDir ".fsdocs"
130-
DotNet.exec id "fsdocs" "build --clean --properties Configuration=Release" |> ignore
131-
)
132-
133-
// --------------------------------------------------------------------------------------
134-
// Release
135-
136-
Target.create "PublishNuget" (fun _ ->
137-
let source = "https://api.nuget.org/v3/index.json"
138-
let apikey = Environment.environVar "NUGET_KEY"
139-
for artifact in !! (artifactsDir + "/*nupkg") do
140-
if not (artifact.Contains(".symbols")) then
141-
let result = DotNet.exec id "nuget" (sprintf "push -s %s -k %s %s" source apikey artifact)
142-
if not result.OK then failwith "failed to push packages"
143-
)
144-
Target.create "ReleaseDocs" (fun _ ->
145-
Git.Repository.clone "" projectRepo "temp/gh-pages"
146-
Git.Branches.checkoutBranch "temp/gh-pages" "gh-pages"
147-
Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A"
148-
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s"
149-
let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" release.NugetVersion
150-
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s"
151-
Git.Branches.push "temp/gh-pages"
152-
)
153-
154-
Target.create "Release" (fun _ ->
155-
Git.Branches.tag "" release.NugetVersion
156-
Git.Branches.pushTag "" projectRepo release.NugetVersion
157-
130+
DotNet.exec id "fsdocs" "build --clean --properties Configuration=Release --eval" |> ignore
158131
)
159132

160133
// --------------------------------------------------------------------------------------
@@ -164,16 +137,13 @@ Target.create "All" ignore
164137

165138
"Clean"
166139
==> "Build"
167-
==> "RunTests"
140+
==> "Test"
168141
==> "NuGet"
169-
==> "GenerateDocs"
170142
==> "All"
171143

172-
"NuGet" ==> "PublishNuget"
173-
"GenerateDocs" ==> "ReleaseDocs"
174-
175-
"PublishNuget"
176-
==> "ReleaseDocs"
177-
==> "Release"
144+
"Clean"
145+
==> "Build"
146+
==> "GenerateDocs"
147+
==> "All"
178148

179149
Target.runOrDefault "All"

docs/_template.fsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
{{code}}

docs/_template.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
{{cells}}

0 commit comments

Comments
 (0)