Skip to content

chore: hold the package version in one place - #13

Merged
andregoepel merged 1 commit into
mainfrom
chore/consolidate-package-version
Aug 23, 2026
Merged

andregoepel merged 1 commit into
mainfrom
chore/consolidate-package-version

Conversation

@andregoepel

Copy link
Copy Markdown
Owner

The per-project <Version> fields in this repo were dead and misleading.

CI publishes with -p:Version=${GITHUB_REF_NAME#v}, so the git tag has
always been the real version. These values never reached NuGet — they only told
anyone reading the csproj, or packing locally, something untrue.

Value
csproj said 1.0.0
actually published 1.0.2

The change

One <Version> in the shared Directory.Build.props — which every package
here already inherits for Authors, RepositoryUrl and the rest — and the
per-project copies removed. Seeded with the version actually published.

Consolidated rather than just corrected, because correcting would drift again on
the next release. app-foundation is the proof of that: six copies, five reading
1.8.0 and MailService reading 1.9.0, against a published 2.1.0 — per-project
versioning was once intended and died quietly when CI started packing everything
from one tag. This makes that reality explicit instead of leaving six places to
forget.

Behaviour is unchanged where it matters

Verified by packing both ways rather than reasoning about it:

Produces
CI path — dotnet pack -p:Version=9.9.9 …9.9.9.nupkg
local path — no override …1.0.2.nupkg (previously a stale number)

-p:Version still wins, so nothing about publishing changes.

Verification

  • dotnet build — 0 errors, 0 warnings
  • Full test suite green
  • dotnet csharpier check . clean
  • Only Directory.Build.props and src/*/*.csproj touched

Part of a sweep across all seven packable repos, which were stale in five of
them.

The per-project <Version> fields were dead and misleading. CI publishes
with -p:Version=${GITHUB_REF_NAME#v}, so the git tag has always been the
real version and these values never reached NuGet — they only told anyone
reading the csproj, or packing locally, something untrue.

They had drifted accordingly. Worst case was app-foundation: six copies,
five reading 1.8.0 and MailService reading 1.9.0, against a published
2.1.0 — evidence that per-project versioning was once intended and died
quietly when CI started packing everything from one tag.

Moved to the shared Directory.Build.props, which every package here
already inherits, and removed the per-project copies. One line per repo
instead of one per project, seeded with the version actually published.

Behaviour is unchanged where it matters: -p:Version still overrides, so
CI packs exactly as before. A local pack now reports the released version
rather than a stale one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant