Created
September 5, 2023 13:45
-
-
Save egil/f14d1f7b4fdc73597ed44ea3e038cb8d to your computer and use it in GitHub Desktop.
Want to embed a changelog file's content inside the <PackageReleaseNotes> in your libraries, so it is readily visible on NuGET, you can do the following:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Automatically copy the content of a CHANGELOG.md file into a NuGET package's change log section via the `<PackageReleaseNotes>` element in .csproj by doing the following: | |
Put the following into your .csproj, e.g. `Lib.csproj`, and the content of your CHANGELOG.md will be embedded when the project is packaged. | |
This assumes that the project structure is as follows: | |
\CHANGELOG.md | |
\src\Lib\Lib.csproj | |
--> | |
<Target Name="SetPackageReleaseNotes" BeforeTargets="GenerateNuspec"> | |
<PropertyGroup> | |
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../../CHANGELOG.md"))</PackageReleaseNotes> | |
</PropertyGroup> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment