You can append build metadata to the calculated version using MinVerBuildMetadata.
- In CI (e.g., GitHub Actions): Set the
MINVERBUILDMETADATA environment variable. This metadata will be appended to any build metadata already present in the Git tag. - In MSBuild: Use the
MinVerBuildMetadata property.
Note: Build metadata is only included in the AssemblyInformationalVersion. If you need it in other fields like FileVersion or PackageVersion, you must use a custom MSBuild target that runs after MinVer.
<!-- Example: GitHub Actions environment variable -->
```yaml
env:
MINVERBUILDMETADATA: build.${{ github.run_id }}.${{ github.run_attempt }}
<!-- Example: Custom MSBuild target for FileVersion -->
<Target Name="MyTarget" AfterTargets="MinVer" Condition="'$(MinVerBuildMetadata)' != ''" >
<PropertyGroup>
<GITHUB_RUN_NUMBER Condition="'$(GITHUB_RUN_NUMBER)' == ''">0</GITHUB_RUN_NUMBER>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(GITHUB_RUN_NUMBER)</FileVersion>
</PropertyGroup>
</Target>