Skip to content

Commit

Permalink
Remove unused release code from the build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Nov 10, 2024
1 parent 4040f5a commit 258d6ca
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 67 deletions.
60 changes: 0 additions & 60 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#load "./.fake/build.fsx/intellisense_lazy.fsx"
#endif

open Fake.Api
open Fake.BuildServer
open Fake.Core
open Fake.Core.TargetOperators
Expand Down Expand Up @@ -144,11 +143,6 @@ BuildServer.install [GitHubActions.Installer]
let githubToken = lazy(Environment.environVarOrFail "farkle-github-token")
let nugetKey = lazy(Environment.environVarOrFail "NUGET_KEY")

Target.description "Fails the build if the appropriate environment variables for the release do not exist"
Target.create "CheckForReleaseCredentials" (fun _ ->
githubToken.Value |> ignore
nugetKey.Value |> ignore)

let fReleaseConfiguration x = {x with DotNet.BuildOptions.Configuration = configuration}

let inline fCommonOptions x =
Expand Down Expand Up @@ -310,19 +304,6 @@ Target.create "NuGetPack" (fun _ ->
Seq.iter pushArtifact nugetPackages
)

Target.description "Publishes the NuGet packages"
Target.create "NuGetPublish" (fun _ ->
Seq.iter (DotNet.nugetPush (fun p ->
{p with
PushParams =
{p.PushParams with
Source = Some "https://www.nuget.org"
ApiKey = Some nugetKey.Value
}
}
)) nugetPackages
)

// --------------------------------------------------------------------------------------
// Generate the documentation

Expand Down Expand Up @@ -378,20 +359,6 @@ Target.create "GenerateDocs" (fun _ ->
Target.description "Generates the website for the project - for local use"
Target.create "GenerateDocsDebug" (fun _ -> generateDocs false false)

Target.description "Releases the documentation to GitHub Pages."
Target.create "ReleaseDocs" (fun _ ->
let tempDocsDir = "temp/gh-pages"
Shell.cleanDir tempDocsDir
Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir

// Some files might no longer exist; better delete them all before the copy.
!! "temp/gh-pages/**" -- "temp/gh-pages/.git/**" |> File.deleteAll
Shell.copyRecursive docsOutput tempDocsDir true |> Trace.tracefn "Copied %A"
Staging.stageAll tempDocsDir
Commit.exec tempDocsDir (sprintf "Update generated documentation for version %s" nugetVersion)
Branches.push tempDocsDir
)

// --------------------------------------------------------------------------------------
// Release Scripts

Expand All @@ -408,27 +375,6 @@ Target.create "PublishBenchmarkReport" (fun _ ->
Branches.pushBranch "" remoteToPush.Value (Information.getBranchName "")
)

Target.description "Makes a tag on the current commit, and a GitHub release afterwards."
Target.create "GitHubRelease" (fun _ ->

Branches.tag "" nugetVersion
Branches.pushTag "" remoteToPush.Value nugetVersion

GitHub.createClientWithToken githubToken.Value
|> GitHub.createRelease gitOwner gitName nugetVersion
(fun x ->
{x with
Name = sprintf "Version %s" nugetVersion
Prerelease = releaseInfo.SemVer.PreRelease.IsSome
Body = releaseNotes |> Seq.map (sprintf "* %s") |> String.concat Environment.NewLine})
|> GitHub.uploadFiles releaseArtifacts
|> GitHub.publishDraft
|> Async.RunSynchronously
)

Target.description "Publishes the documentation and makes a GitHub release"
Target.create "Release" ignore

// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build target <Target>' to override

Expand Down Expand Up @@ -468,11 +414,5 @@ Target.create "Release" ignore

"Clean"
==> "NuGetPack"
==> "NuGetPublish"
==> "GitHubRelease"

"CheckForReleaseCredentials"
==> "GitHubRelease"
==> "Release"

Target.runOrDefault "NuGetPack"
3 changes: 0 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ group FakeBuild

nuget FSharp.Core ~> 6

nuget Fake.Api.GitHub ~> 5
nuget Fake.BuildServer.GitHubActions ~> 5
nuget Fake.Core.ReleaseNotes ~> 5
nuget Fake.Core.Target ~> 5
Expand All @@ -29,6 +28,4 @@ group FakeBuild

nuget MSBuild.StructuredLogger

nuget Octokit = 0.48

nuget Scriban
4 changes: 0 additions & 4 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ NUGET
BlackFox.VsWhere (1.1)
FSharp.Core (>= 4.2.3)
Microsoft.Win32.Registry (>= 4.7)
Fake.Api.GitHub (5.20.4)
FSharp.Core (>= 4.7.2)
Octokit (>= 0.48)
Fake.BuildServer.GitHubActions (5.23.1)
Fake.Core.Environment (>= 5.23.1)
Fake.Core.Trace (>= 5.23.1)
Expand Down Expand Up @@ -175,7 +172,6 @@ NUGET
NuGet.Protocol (5.10)
NuGet.Packaging (>= 5.10)
NuGet.Versioning (5.10)
Octokit (0.48)
Scriban (4.0.1)
Microsoft.CSharp (>= 4.5)
System.Threading.Tasks.Extensions (>= 4.5)
Expand Down

0 comments on commit 258d6ca

Please sign in to comment.