Esempio n. 1
0
        public static ICollection <string> UpdateReleaseNotes(
            this ICakeContext context,
            ReleaseNotesSettings releaseNotesSettings,
            NuGetPackSettings nuGetPackSettings = null)
        {
            var releaseNotes =
                FilterLines(File.ReadLines(releaseNotesSettings.ReleaseNotesVNext.FullPath)).ToList();

            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine($"## {releaseNotesSettings.Version}");
            stringBuilder.AppendLine();

            foreach (var line in releaseNotes)
            {
                stringBuilder.AppendLine($"- {line}");
            }

            stringBuilder.AppendLine();
            stringBuilder.Append(File.ReadAllText(releaseNotesSettings.ReleaseNotes.FullPath));
            File.WriteAllText(releaseNotesSettings.ReleaseNotes.FullPath, stringBuilder.ToString());

            var nextVersion = releaseNotesSettings.Version.Bump(BumpMethod.Patch);

            File.WriteAllText(releaseNotesSettings.ReleaseNotesVNext.FullPath, $"## {nextVersion}");

            if (!(nuGetPackSettings is null))
            {
                nuGetPackSettings.ReleaseNotes = releaseNotes;
            }

            return(releaseNotes);
        }
Esempio n. 2
0
 public static bool ReleaseNotesUpdated(
     this ICakeContext context,
     ReleaseNotesSettings settings)
 => AnyReleaseNotes(context, settings.ReleaseNotesVNext);