Skip to content

Commit

Permalink
CycloneDX#842 Added in the release notes
Browse files Browse the repository at this point in the history
Signed-off-by: James Thompson <[email protected]>
  • Loading branch information
thompson-tomo committed Jan 30, 2024
1 parent db5775b commit 0636839
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion CycloneDX/Services/NugetV3Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.Diagnostics.Contracts;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -310,7 +311,39 @@ private static Component SetupComponentProperties(Component component, NuspecMod
{
component.Publisher = component.Author;
}


var releaseNoteType = "internal";
var version = nuspecModel.nuspecReader.GetVersion();
if (version.IsPrerelease)
{
releaseNoteType = "pre-release";
}
else if (version.Minor == 0 && version.Patch == 0)
{
releaseNoteType = "major";
}
else if (version.Minor != 0 && version.Patch == 0)
{
releaseNoteType = "minor";
}
else if (version.Patch != 0)
{
releaseNoteType = "patch";
}
component.ReleaseNotes = new ReleaseNotes()
{
Type = releaseNoteType,
Title = version.ToString(),
Tags = version.ReleaseLabels.ToList(),
Notes = [
new Note()
{
Text = new AttachedText(){
Content = nuspecModel.nuspecReader.GetReleaseNotes()
}
}
]
};
return component;
}

Expand Down

0 comments on commit 0636839

Please sign in to comment.