Context
dotnet-templates-fullstack#71 (https://github.com/NetChris/dotnet-templates-fullstack/issues/71),
not yet merged (https://github.com/NetChris/dotnet-templates-fullstack/pull/76), replaces this
action with Nerdbank.GitVersioning (NBGV) for
stamping a real AssemblyVersion/AssemblyInformationalVersion into .NET builds.
The problem that prompted it: dotnet-templates-fullstack builds once on every push (to any
branch) and only retags, never rebuilds, at release time. On a push to main, github.ref has no
SemVer or "major.minor" pattern in it, so parse-semver fell back to 0.0, and that fallback
value is what shipped in every build until the next release finally supplied a real tag, at which
point it was already too late since the image had already been built and would only be retagged,
not rebuilt.
NBGV solves this differently than parse-semver does: it computes a version from a version.json
file plus git commit height, with no dependency on a git tag existing at all, and integrates
directly into dotnet build/dotnet publish via MSBuild, rather than needing its output piped
into a /p:Version= override by hand.
Scope check before considering retirement
A search across the org turned up more consumers than expected. This is not a single-repo tool:
NetChris/semver-release and NetChris/semver-pre-release are built directly on this
action, each is an additional layer of indirection for anything that consumes them.
NetChris/dotnet-templates uses it in several workflows, and also stamps it into the
workflow files of every project generated from that template.
NetChris/NetChris.Applications.Assets uses it in four workflows.
NetChris/workflows uses it in two reusable workflows that other repos call.
NetChris/dotnet-templates-fullstack is the one currently being migrated away from it.
parse-semver also does more than what NBGV replaces. semver-release/semver-pre-release use
its semver_version output as a hard gate, failing the build when the ref genuinely is not a valid
SemVer tag. NBGV has no equivalent to that: it always produces some version, computed from git
height, and never fails a build for lacking a tag. So this is not a clean drop-in replacement
everywhere this action is used, only for the specific "stamp a .NET assembly version, tag or no
tag" use case dotnet-templates-fullstack had.
Open question
Once NBGV has actually proven out in production in dotnet-templates-fullstack (after #76 merges
and at least one real release goes through it), is it worth migrating the other .NET consumers
listed above to NBGV too, and retiring this action, or does the gate behavior and the non-.NET-specific
generality this action offers mean it should stay around for at least some of them?
Done when
Context
dotnet-templates-fullstack#71 (https://github.com/NetChris/dotnet-templates-fullstack/issues/71),not yet merged (https://github.com/NetChris/dotnet-templates-fullstack/pull/76), replaces this
action with Nerdbank.GitVersioning (NBGV) for
stamping a real
AssemblyVersion/AssemblyInformationalVersioninto .NET builds.The problem that prompted it:
dotnet-templates-fullstackbuilds once on every push (to anybranch) and only retags, never rebuilds, at release time. On a push to
main,github.refhas noSemVer or "major.minor" pattern in it, so
parse-semverfell back to0.0, and that fallbackvalue is what shipped in every build until the next release finally supplied a real tag, at which
point it was already too late since the image had already been built and would only be retagged,
not rebuilt.
NBGV solves this differently than
parse-semverdoes: it computes a version from aversion.jsonfile plus git commit height, with no dependency on a git tag existing at all, and integrates
directly into
dotnet build/dotnet publishvia MSBuild, rather than needing its output pipedinto a
/p:Version=override by hand.Scope check before considering retirement
A search across the org turned up more consumers than expected. This is not a single-repo tool:
NetChris/semver-releaseandNetChris/semver-pre-releaseare built directly on thisaction, each is an additional layer of indirection for anything that consumes them.
NetChris/dotnet-templatesuses it in several workflows, and also stamps it into theworkflow files of every project generated from that template.
NetChris/NetChris.Applications.Assetsuses it in four workflows.NetChris/workflowsuses it in two reusable workflows that other repos call.NetChris/dotnet-templates-fullstackis the one currently being migrated away from it.parse-semveralso does more than what NBGV replaces.semver-release/semver-pre-releaseuseits
semver_versionoutput as a hard gate, failing the build when the ref genuinely is not a validSemVer tag. NBGV has no equivalent to that: it always produces some version, computed from git
height, and never fails a build for lacking a tag. So this is not a clean drop-in replacement
everywhere this action is used, only for the specific "stamp a .NET assembly version, tag or no
tag" use case
dotnet-templates-fullstackhad.Open question
Once NBGV has actually proven out in production in
dotnet-templates-fullstack(after #76 mergesand at least one real release goes through it), is it worth migrating the other .NET consumers
listed above to NBGV too, and retiring this action, or does the gate behavior and the non-.NET-specific
generality this action offers mean it should stay around for at least some of them?
Done when
NBGV is proven out.
since this is too large a change to land as one PR here.