Skip to content

Commit fbcb5e8

Browse files
committed
ci: fix release logic
1 parent f033c2c commit fbcb5e8

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [Unreleased]
8-
- Some basic functions added: `filter`, `bind`, `concat`, `distinct`, `mapi`, `skip`, `take`, ...
9-
- rxquery { ... } builder added
9+
10+
- Added some basic functions: `filter/where`, `bind`, `concat`, `distinct`, `mapi`, `skip`, `take`, …
11+
- Added `rxquery { … }` builder
1012

1113
## [0.1.0] - 2024-11-18
1214
First pre-release
@@ -15,4 +17,4 @@ First pre-release
1517
- Initial implementation of the library
1618
- `map`, `iter` and `length` functions
1719

18-
[0.1.0]: https://github.com/fsprojects/FSharp.Control.R3/releases/tag/v0.1.0
20+
[0.1.0]: https://github.com/fsprojects/FSharp.Control.R3/releases/tag/releases/0.1.0

build/Changelog.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let isEmptyChange =
1414
| Changelog.Change.Security s
1515
| Changelog.Change.Custom (_, s) -> String.IsNullOrWhiteSpace s.CleanedText
1616

17-
let tagFromVersionNumber versionNumber = sprintf "v%s" versionNumber
17+
let tagFromVersionNumber versionNumber = sprintf "releases/%s" versionNumber
1818

1919
let failOnEmptyChangelog (latestEntry : Changelog.ChangelogEntry) =
2020
let isEmpty =
@@ -27,7 +27,7 @@ let failOnEmptyChangelog (latestEntry : Changelog.ChangelogEntry) =
2727
let mkLinkReference (newVersion : SemVerInfo) (changelog : Changelog.Changelog) (gitHubRepoUrl : string) =
2828
if changelog.Entries |> List.isEmpty then
2929
// No actual changelog entries yet: link reference will just point to the Git tag
30-
sprintf "[%s]: %s/releases/tag/%s" newVersion.AsString (gitHubRepoUrl.TrimEnd ('/')) (tagFromVersionNumber newVersion.AsString)
30+
sprintf "[%s]: %s/releases/tag/%s" newVersion.AsString gitHubRepoUrl (tagFromVersionNumber newVersion.AsString)
3131
else
3232
let versionTuple version = (version.Major, version.Minor, version.Patch)
3333
// Changelog entries come already sorted, most-recent first, by the Changelog module

build/Properties/launchSettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"BuildDocs": {
1616
"commandName": "Project",
1717
"commandLineArgs": "--target BuildDocs"
18+
},
19+
"Release": {
20+
"commandName": "Project",
21+
"commandLineArgs": "--target Release 0.2.0"
1822
}
1923
}
2024
}

build/build.fs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ let watchDocsDir = temp </> "watch-docs"
6565
let gitOwner = "fsprojects"
6666
let gitRepoName = "FSharp.Control.R3"
6767

68-
let gitHubRepoUrl = $"https://github.com/%s{gitOwner}/%s{gitRepoName}/"
68+
let gitHubRepoUrl = $"https://github.com/%s{gitOwner}/%s{gitRepoName}"
6969

70-
let documentationRootUrl = $"https://%s{gitOwner}.github.io/%s{gitRepoName}/"
70+
let documentationRootUrl = $"https://%s{gitOwner}.github.io/%s{gitRepoName}"
7171

7272
let releaseBranch = "main"
7373
let readme = "README.md"
@@ -190,7 +190,7 @@ module DocsTool =
190190
Parameters =
191191
Some [
192192
// https://fsprojects.github.io/FSharp.Formatting/content.html#Templates-and-Substitutions
193-
"root", quoted documentationRootUrl
193+
"root", quoted $"{documentationRootUrl}/"
194194
"fsdocs-collection-name", quoted productName
195195
"fsdocs-repository-branch", quoted releaseBranch
196196
"fsdocs-package-version", quoted latestEntry.NuGetVersion
@@ -200,7 +200,6 @@ module DocsTool =
200200
Strict = Some true
201201
}
202202

203-
204203
let cleanDocsCache () = Fsdocs.cleanCache rootDirectory
205204

206205
let build (configuration) = Fsdocs.build fsDocsDotnetOptions (fsDocsBuildParams configuration)
@@ -216,9 +215,8 @@ module DocsTool =
216215

217216
Fsdocs.watch fsDocsDotnetOptions (fun p -> { p with BuildCommandParams = Some (buildParams p.BuildCommandParams) })
218217

219-
let allReleaseChecks () =
220-
failOnWrongBranch ()
221-
Changelog.failOnEmptyChangelog latestEntry
218+
let allReleaseChecks () = failOnWrongBranch ()
219+
//Changelog.failOnEmptyChangelog latestEntry
222220

223221

224222
let failOnLocalBuild () =
@@ -501,13 +499,14 @@ let gitRelease _ =
501499

502500
let releaseNotesGitCommitFormat = latestEntry.ToString ()
503501

504-
Git.Staging.stageFile "" "CHANGELOG.md" |> ignore
502+
Git.Staging.stageFile "" (rootDirectory </> "CHANGELOG.md")
503+
|> ignore
505504

506505
!!(rootDirectory </> "src/**/AssemblyInfo.fs")
507506
++ (rootDirectory </> "tests/**/AssemblyInfo.fs")
508507
|> Seq.iter (Git.Staging.stageFile "" >> ignore)
509508

510-
let msg = sprintf "Bump version to %s\n\n%s" latestEntry.NuGetVersion releaseNotesGitCommitFormat
509+
let msg = $"Bump version to `%s{latestEntry.NuGetVersion}`\n\n%s{releaseNotesGitCommitFormat}"
511510

512511
Git.Commit.exec "" msg
513512

@@ -526,7 +525,7 @@ let githubRelease _ =
526525
let token =
527526
match githubToken with
528527
| Some s -> s
529-
| _ -> failwith "please set the github_token environment variable to a github personal access token with repo access."
528+
| _ -> failwith "please set the `GITHUB_TOKEN` environment variable to a github personal access token with repo access."
530529

531530
let files = !!distGlob
532531
// Get release notes with properly-linked version number
@@ -664,6 +663,7 @@ let initTargets () =
664663
==>! "Publish"
665664

666665
"DotnetRestore" =?> ("CheckFormatCode", isCI.Value)
666+
==> "GenerateAssemblyInfo"
667667
==> "DotnetBuild"
668668
==> "DotnetTest"
669669
==> "DotnetPack"

0 commit comments

Comments
 (0)