Skip to content

Commit ef3b457

Browse files
committed
update version logic
1 parent 3e5c2d8 commit ef3b457

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

AGENTS.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FSharp.Control.TaskSeq is an F# library providing a `taskSeq` computation expres
1010
- `src/FSharp.Control.TaskSeq.Test/` — xUnit test project (net9.0)
1111
- `src/FSharp.Control.TaskSeq.SmokeTests/` — Smoke/integration tests
1212
- `src/FSharp.Control.TaskSeq.sln` — Solution file
13-
- `Version.props`Single source of truth for the package version
13+
- `Version.props`Package version (derived automatically from `release-notes.txt`)
1414
- `build.cmd` — Windows build/test script used by CI
1515

1616
## Build
@@ -102,12 +102,28 @@ All workflows are in `.github/workflows/`:
102102

103103
## Release Notes
104104

105-
**Required**: Every PR that adds features, fixes bugs, or makes user-visible changes **must** include an update to `release-notes.txt`. Add a bullet under the appropriate version heading (currently `0.5.0`). The format is:
105+
`release-notes.txt` is the **single source of truth** for the package version. `Version.props` extracts the version automatically by finding the first line that matches a `X.Y.Z` semver pattern. The `Unreleased` section at the top of the file is skipped because it does not match this pattern.
106+
107+
**Format requirements:**
108+
109+
- The file **must** always begin with a heading line `Unreleased` (after the optional `Release notes:` header). This section holds in-progress changes before they are assigned a version number. It must always be present, even if empty.
110+
- Below `Unreleased`, versioned sections are listed in descending order (`1.0.0`, `0.7.0`, …). The topmost versioned section determines the package version.
111+
- To bump the version, add a new version heading between `Unreleased` and the previous version.
112+
113+
Example:
106114

107115
```
108-
0.5.0
116+
Release notes:
117+
118+
Unreleased
119+
- upcoming change description
120+
121+
1.1.0
109122
- adds TaskSeq.myFunction and TaskSeq.myFunctionAsync, #<issue>
110123
- fixes <description>, #<issue>
124+
125+
1.0.0
126+
- adds TaskSeq.withCancellation, #167
111127
```
112128

113-
If you are bumping to a new version, also update `Version.props`. PRs that touch library source (`src/FSharp.Control.TaskSeq/`) without updating `release-notes.txt` are incomplete.
129+
**Required**: Every PR that adds features, fixes bugs, or makes user-visible changes **must** add a bullet under the `Unreleased` heading in `release-notes.txt`. PRs that touch library source (`src/FSharp.Control.TaskSeq/`) without updating `release-notes.txt` are incomplete.

Version.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<!-- updating this version will trigger a publish after merge to 'main' -->
4-
<Version>1.0.1</Version>
3+
<!-- Version is extracted from the first versioned section heading in release-notes.txt -->
4+
<Version>$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText(`$(MSBuildThisFileDirectory)release-notes.txt`)), `(?m)^(\d+\.\d+\.\d+)`).Groups.get_Item(1).Value)</Version>
55
</PropertyGroup>
66
</Project>

release-notes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Release notes:
33

4-
1.0.1
4+
Unreleased
55
- adds taskSeqDynamic computation expression and TaskSeqDynamic/TaskSeqDynamicInfo types for dynamic (FSI-compatible) resumable code, fixing issue where taskSeq would raise NotImplementedException in F# Interactive, #246
66
- perf: simplify iter, fold, reduce, mapFold, tryLast, skipOrTake (Drop/Truncate) to use while! and remove manual go-flag and initial MoveNextAsync pre-advance, matching the pattern already used by sum/sumBy/average
77
- perf: toResizeArrayAsync (and therefore toArrayAsync, toListAsync, toResizeArrayAsync, toIListAsync) uses a direct loop instead of going through iter, avoiding a lambda and DU allocation per call

0 commit comments

Comments
 (0)