Skip to content

Commit f21c1f7

Browse files
committed
ci: set conditional dependency of PublishToGitHub target on GenerateAssemblyInfo to fix publishing to GitHub
1 parent f9fdff4 commit f21c1f7

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

build/build.fs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,17 @@ let watchDocs ctx =
573573
DocsTool.watch (string configuration)
574574

575575

576-
let initTargets () =
576+
let initTargets (ctx : Context.FakeExecutionContext) =
577577
BuildServer.install [ GitHubActions.Installer ]
578578

579+
let isPublishToGitHub =
580+
ctx.Arguments
581+
|> Seq.pairwise
582+
|> Seq.exists (fun (arg, value) ->
583+
(String.Equals (arg, "-t", StringComparison.OrdinalIgnoreCase)
584+
|| String.Equals (arg, "--target", StringComparison.OrdinalIgnoreCase))
585+
&& String.Equals (value, "PublishToGitHub", StringComparison.OrdinalIgnoreCase))
586+
579587
/// Defines a dependency - y is dependent on x. Finishes the chain.
580588
let (==>!) x y = x ==> y |> ignore
581589

@@ -651,7 +659,7 @@ let initTargets () =
651659
==>! "ShowCoverageReport"
652660

653661
"UpdateChangelog"
654-
==> "GenerateAssemblyInfo"
662+
=?> ("GenerateAssemblyInfo", not isPublishToGitHub)
655663
==> "GitRelease"
656664
==>! "Release"
657665

@@ -664,8 +672,9 @@ let initTargets () =
664672
==> "GitHubRelease"
665673
==>! "Publish"
666674

667-
"DotnetRestore" =?> ("CheckFormatCode", isCI.Value)
668-
==> "GenerateAssemblyInfo"
675+
"DotnetRestore"
676+
=?> ("CheckFormatCode", isCI.Value)
677+
=?> ("GenerateAssemblyInfo", isPublishToGitHub)
669678
==> "DotnetBuild"
670679
==> "DotnetTest"
671680
==> "DotnetPack"
@@ -678,13 +687,14 @@ let initTargets () =
678687
//-----------------------------------------------------------------------------
679688
[<EntryPoint>]
680689
let main argv =
681-
argv
682-
|> Array.toList
683-
|> Context.FakeExecutionContext.Create false "build.fsx"
684-
|> Context.RuntimeContext.Fake
685-
|> Context.setExecutionContext
686690

687-
initTargets ()
691+
let ctx =
692+
argv
693+
|> Array.toList
694+
|> Context.FakeExecutionContext.Create false "build.fsx"
695+
696+
Context.setExecutionContext (Context.RuntimeContext.Fake ctx)
697+
initTargets ctx
688698
Target.runOrDefaultWithArguments "DotnetPack"
689699

690700
0 // return an integer exit code

src/FSharp.Control.R3/AssemblyInfo.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ open System.Reflection
55
[<assembly: AssemblyTitleAttribute("FSharp.Control.R3")>]
66
[<assembly: AssemblyProductAttribute("FSharp.Control.R3")>]
77
[<assembly: AssemblyVersionAttribute("0.1.0")>]
8-
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2017-03-17T00:00:00.0000000")>]
8+
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2024-11-18T00:00:00.0000000")>]
99
[<assembly: AssemblyFileVersionAttribute("0.1.0")>]
1010
[<assembly: AssemblyInformationalVersionAttribute("0.1.0")>]
1111
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
12-
[<assembly: AssemblyMetadataAttribute("GitHash","bb8964b54bee133e9af64d316dc2cfee16df7f72")>]
12+
[<assembly: AssemblyMetadataAttribute("GitHash","7accd8a9a4e8434e48b501db88ddac111f40e1a5")>]
1313
do ()
1414

1515
module internal AssemblyVersionInformation =
1616
let [<Literal>] AssemblyTitle = "FSharp.Control.R3"
1717
let [<Literal>] AssemblyProduct = "FSharp.Control.R3"
1818
let [<Literal>] AssemblyVersion = "0.1.0"
19-
let [<Literal>] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000"
19+
let [<Literal>] AssemblyMetadata_ReleaseDate = "2024-11-18T00:00:00.0000000"
2020
let [<Literal>] AssemblyFileVersion = "0.1.0"
2121
let [<Literal>] AssemblyInformationalVersion = "0.1.0"
2222
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
23-
let [<Literal>] AssemblyMetadata_GitHash = "bb8964b54bee133e9af64d316dc2cfee16df7f72"
23+
let [<Literal>] AssemblyMetadata_GitHash = "7accd8a9a4e8434e48b501db88ddac111f40e1a5"

0 commit comments

Comments
 (0)