Skip to content

Commit 9b82273

Browse files
Move generated changelog details to a separate branch
1 parent 4e9edb0 commit 9b82273

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+21
-5137
lines changed

build/Build.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
99
<PackageReference Include="Cake.FileHelpers" Version="6.1.3" />
10+
<PackageReference Include="Cake.Git" Version="3.0.0" />
1011
<PackageReference Include="Microsoft.DocAsCode.App" Version="2.67.3" />
1112
<PackageReference Include="Ben.Demystifier" Version="0.1.1" />
1213
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />

build/Program.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Cake.Core.IO;
1818
using Cake.FileHelpers;
1919
using Cake.Frosting;
20+
using Cake.Git;
2021

2122
public static class Program
2223
{
@@ -103,11 +104,11 @@ public BuildContext(ICakeContext context)
103104
MsBuildSettingsRestore = new DotNetMSBuildSettings();
104105
MsBuildSettingsBuild = new DotNetMSBuildSettings();
105106
MsBuildSettingsPack = new DotNetMSBuildSettings();
106-
107+
107108
if (IsCiBuild)
108109
{
109110
System.Environment.SetEnvironmentVariable("BDN_CI_BUILD", "true");
110-
111+
111112
MsBuildSettingsBuild.MaxCpuCount = 1;
112113
MsBuildSettingsBuild.WithProperty("UseSharedCompilation", "false");
113114
}
@@ -152,8 +153,22 @@ public void RunTests(FilePath projectFile, string alias, string tfm)
152153
this.DotNetTest(projectFile.FullPath, settings);
153154
}
154155

156+
public void EnsureChangelogDetailsExist(bool forceClean = false)
157+
{
158+
var path = ChangeLogGenDirectory.Combine("details");
159+
if (this.DirectoryExists(path) && forceClean)
160+
this.DeleteDirectory(path, new DeleteDirectorySettings() { Force = true, Recursive = true });
161+
162+
if (!this.DirectoryExists(path))
163+
{
164+
var settings = new GitCloneSettings { Checkout = true, BranchName = "docs-changelog-details" };
165+
this.GitClone("https://github.com/dotnet/BenchmarkDotNet.git", path, settings);
166+
}
167+
}
168+
155169
public void DocfxChangelogDownload(string version, string versionPrevious, string lastCommit = "")
156170
{
171+
EnsureChangelogDetailsExist(true);
157172
this.Information("DocfxChangelogDownload: " + version);
158173
// Required environment variables: GITHUB_PRODUCT, GITHUB_TOKEN
159174
var path = ChangeLogGenDirectory.Combine("details");
@@ -162,6 +177,7 @@ public void DocfxChangelogDownload(string version, string versionPrevious, strin
162177

163178
public void DocfxChangelogGenerate(string version)
164179
{
180+
EnsureChangelogDetailsExist();
165181
this.Information("DocfxChangelogGenerate: " + version);
166182
var header = ChangeLogGenDirectory.Combine("header").CombineWithFilePath(version + ".md");
167183
var footer = ChangeLogGenDirectory.Combine("footer").CombineWithFilePath(version + ".md");
@@ -551,4 +567,4 @@ public override void Run(BuildContext context)
551567
context.RunDocfx(context.DocfxJsonFile);
552568
context.GenerateRedirects();
553569
}
554-
}
570+
}

docs/_changelog/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
details

docs/_changelog/details/v0.10.0.md

Lines changed: 0 additions & 138 deletions
This file was deleted.

docs/_changelog/details/v0.10.1.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)