Skip to content

Commit 0de44cd

Browse files
committed
fix: sync version.json with the actual release version, fixing every published NuGet version
Root cause of every "release worked but the wrong version got published" mystery this whole project: Nerdbank.GitVersioning never derives the version number from the git tag, even when it correctly detects a public-release tag - it always computes from version.json's own "version" field. That field had sat at "0.1-alpha" unchanged since the first commit, so every release.yml run (v0.1.0 through v0.10.0) published an unrelated 0.1.x-alpha prerelease to NuGet.org instead of its real tagged version. Verified locally: with version.json at "0.1-alpha", nbgv get-version at the exact v0.10.0-tagged commit reports PublicRelease: true but still computes "0.1.69-alpha". Bumping version.json's "version" to the real current version (a full three-component "0.10.0", not just "0.1") makes it compute exactly "0.10.0" at that same commit - confirmed with a throwaway test commit/tag. Also wires release-please-config.json's extra-files to update version.json's "version" field automatically on every future release commit, so the two version sources can't drift apart again. fetch-tags: true added to both workflows' checkout steps as a defensive addition (not the actual cause here, but the standard NBGV+GitHub Actions recommendation regardless).
1 parent c9b0c40 commit 0de44cd

5 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- uses: actions/checkout@v7
1616
with:
1717
fetch-depth: 0 # full history - Nerdbank.GitVersioning needs it to compute the version
18+
fetch-tags: true # belt-and-braces so a tagged commit's tags are always visible to NBGV
1819

1920
- uses: actions/setup-dotnet@v5
2021
with:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- uses: actions/checkout@v7
2222
with:
2323
fetch-depth: 0
24+
fetch-tags: true # belt-and-braces so a tagged commit's tags are always visible to NBGV
2425

2526
- uses: actions/setup-dotnet@v5
2627
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ own version is independent of Monnify's API versioning.
2020

2121
* envelope handling now tolerates endpoints (e.g. paycodes) that omit `requestSuccessful` from their response
2222
* a non-JSON error body (e.g. a proxy/gateway's own error page for a 502/504) on a failing HTTP status now throws `MonnifyApiException` with the real status code, instead of a misleading `MonnifyDeserializationException` — found via a real sandbox 502 while dogfooding the published package before v1
23+
* `version.json`'s Nerdbank.GitVersioning baseline had sat at `0.1-alpha` since the very first commit and was never kept in sync with the actual released version. NBGV only reads the version *number* from `version.json` itself - it never derives it from the git tag, even when it correctly detects a public-release tag - so every release published so far (`v0.1.0` through `v0.10.0`) actually shipped to NuGet.org as an unrelated `0.1.x-alpha` prerelease instead of its real tagged version. Fixed by bumping `version.json` to the real current version and wiring `release-please-config.json`'s `extra-files` to keep it in sync automatically on every future release, so this can't drift out of sync again
2324

2425
## [0.5.0](https://github.com/Monnify/monnify-dotnet-lib/compare/v0.4.0...v0.5.0) (2026-06-30)
2526

release-please-config.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"packages": {
55
".": {
66
"release-type": "simple",
7-
"changelog-path": "CHANGELOG.md"
7+
"changelog-path": "CHANGELOG.md",
8+
"extra-files": [
9+
{
10+
"type": "json",
11+
"path": "version.json",
12+
"jsonpath": "$.version"
13+
}
14+
]
815
}
916
}
1017
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "0.1-alpha",
3+
"version": "0.10.0",
44
"publicReleaseRefSpec": [
55
"^refs/tags/v\\d+\\.\\d+\\.\\d+$"
66
],

0 commit comments

Comments
 (0)