Skip to content

Commit

Permalink
Add support for setting PackageReleaseNotes for NuGet when publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Mar 6, 2022
1 parent b47888f commit e447942
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dotnet-releaser/Configuration/DevHostingConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ protected DevHostingConfiguration()

public string GetUrl() => $"{Base.Trim('/')}/{User}/{Repo}";

public string GetReleaseNotesUrl(string version) => $"{Base.Trim('/')}/{User}/{Repo}/releases/tag/{VersionPrefix}{version}";

public void AddDefaults()
{
// Don't add default branches if they are added manually
Expand Down
3 changes: 3 additions & 0 deletions src/dotnet-releaser/ReleaserApp.NuGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ private async Task<bool> BuildNuGetPackage(BuildInformation buildInfo)
properties["PackAsTool"] = "true";
}

// Set a link back to GitHub release notes
properties["PackageReleaseNotes"] = _config.GitHub.GetReleaseNotesUrl(projectPackageInfo.Version);

// We need to inject via props to support multi-targeting projects
var outputs = await RunMSBuild(projectPackageInfo.ProjectFullPath, ReleaserConstants.DotNetReleaserPackAndGetNuGetPackOutput, properties, injectViaProps: true);
if (outputs is null) return null;
Expand Down

0 comments on commit e447942

Please sign in to comment.