@@ -573,9 +573,17 @@ let watchDocs ctx =
573
573
DocsTool.watch ( string configuration)
574
574
575
575
576
- let initTargets () =
576
+ let initTargets ( ctx : Context.FakeExecutionContext ) =
577
577
BuildServer.install [ GitHubActions.Installer ]
578
578
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
+
579
587
/// Defines a dependency - y is dependent on x. Finishes the chain.
580
588
let (= =>!) x y = x ==> y |> ignore
581
589
@@ -651,7 +659,7 @@ let initTargets () =
651
659
==>! " ShowCoverageReport"
652
660
653
661
" UpdateChangelog"
654
- ==> " GenerateAssemblyInfo"
662
+ =?> ( " GenerateAssemblyInfo" , not isPublishToGitHub )
655
663
==> " GitRelease"
656
664
==>! " Release"
657
665
@@ -664,8 +672,9 @@ let initTargets () =
664
672
==> " GitHubRelease"
665
673
==>! " Publish"
666
674
667
- " DotnetRestore" =?> ( " CheckFormatCode" , isCI.Value)
668
- ==> " GenerateAssemblyInfo"
675
+ " DotnetRestore"
676
+ =?> ( " CheckFormatCode" , isCI.Value)
677
+ =?> ( " GenerateAssemblyInfo" , isPublishToGitHub)
669
678
==> " DotnetBuild"
670
679
==> " DotnetTest"
671
680
==> " DotnetPack"
@@ -678,13 +687,14 @@ let initTargets () =
678
687
//-----------------------------------------------------------------------------
679
688
[<EntryPoint>]
680
689
let main argv =
681
- argv
682
- |> Array.toList
683
- |> Context.FakeExecutionContext.Create false " build.fsx"
684
- |> Context.RuntimeContext.Fake
685
- |> Context.setExecutionContext
686
690
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
688
698
Target.runOrDefaultWithArguments " DotnetPack"
689
699
690
700
0 // return an integer exit code
0 commit comments