Skip to content

Commit

Permalink
build.fsx,RELEASE.md: improve preRelease version numbers
Browse files Browse the repository at this point in the history
After we added[1] support for uploading prerelease nuget packages,
the versions chosen for these would increment the "Minor" part of
the last version released. Example: if last released version was
0.21.7, then the prerelease uploaded would start as something like
'0.22.0-date...'.

But this was not a good strategy because if the next version
released after 0.21.7 is 0.21.8, then the 0.22.x packages would
still be listed earlier than the 0.21.8 package in nuget, falsely
implying that they are "ahead" of 0.21.8, when actually they were
somewhere between 0.21.7 and 0.21.8.

Therefore we now make the increment happen at the Revision level
instead of at the Minor level. So the prereleases after releasing
a "0.21.8" for example, will start as '0.21.9-date...'.

And to be more in line with this change, we're gonna start the
convention of adding +2 to the Revision every time we tag a
release. This way, even numbers will give a "stable" aspect (as
they are not a prerelease anyway): 0.21.8, 0.21.10, 0.21.12...
And odd numbers will be prereleases: 0.21.9-date..., 0.21.11-date...

[1] 9618a8a
  • Loading branch information
knocte committed Dec 20, 2023
1 parent c797e80 commit 901553c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Releasing a new version of FSharpLint

1. Update the [changelog](CHANGELOG.md) since last release and get the changes onto master.
1. Update the [changelog](CHANGELOG.md) since last release and get the changes onto master,
choosing a version that increases the Major or Minor part of the version by 1, or the Revision
part of the version by 2, e.g.: 0.20.2 -> 0.23.0 or 0.20.2 -> 1.0 or 0.20.2 -> 0.20.4.
2. Tag the head of master with the version number in the format `vx.x.x` - for example: `v0.20.2`.
3. Push the tag to remote.

Expand Down
3 changes: 1 addition & 2 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ let nugetVersion =
| (_, false) ->
let current = changelog.LatestEntry.NuGetVersion |> SemVer.parse
let bumped = { current with
Minor = current.Minor + 1u
Patch = 0u
Patch = current.Patch + 1u
Original = None
PreRelease = None }
let bumpedBaseVersion = string bumped
Expand Down

0 comments on commit 901553c

Please sign in to comment.