Skip to content

Commit ffd9bca

Browse files
committed
Merge branch 'develop'
2 parents 93ae18f + 6ca2ba5 commit ffd9bca

File tree

9 files changed

+77
-91
lines changed

9 files changed

+77
-91
lines changed

.config/dotnet-tools.json

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

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ jobs:
5252
NUGET_APIKEY: ${{steps.login.outputs.NUGET_API_KEY}}
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
with:
55-
cake-version: tool-manifest
55+
file-path: cake.cs
5656
target: GitHub-Actions

build/helpers.cake

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

build/helpers.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*****************************
2+
* Helpers
3+
*****************************/
4+
5+
public partial class Program
6+
{
7+
static void Main_SetupExtensions()
8+
{
9+
if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
10+
{
11+
TaskSetup(context => BuildSystem.GitHubActions.Commands.StartGroup(context.Task.Name));
12+
TaskTeardown(context => BuildSystem.GitHubActions.Commands.EndGroup());
13+
}
14+
}
15+
}
16+
17+
18+
public static partial class CakeTaskBuilderExtensions
19+
{
20+
private static ExtensionHelper extensionHelper = new (Task, () => RunTarget(Argument("target", "Default")));
21+
22+
public static CakeTaskBuilder Then(this CakeTaskBuilder cakeTaskBuilder, string name)
23+
=> extensionHelper
24+
.TaskCreate(name)
25+
.IsDependentOn(cakeTaskBuilder);
26+
27+
28+
public static CakeReport Run(this CakeTaskBuilder cakeTaskBuilder)
29+
=> extensionHelper.Run();
30+
31+
public static CakeTaskBuilder Default(this CakeTaskBuilder cakeTaskBuilder)
32+
{
33+
extensionHelper
34+
.TaskCreate("Default")
35+
.IsDependentOn(cakeTaskBuilder);
36+
return cakeTaskBuilder;
37+
}
38+
39+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Func<BuildData, DotNetMSBuildSettings, DotNetMSBuildSettings> MSBuildSettingsCus
1515
public DirectoryPath NuGetOutputPath { get; } = OutputPath.Combine("nuget");
1616
public DirectoryPath BinaryOutputPath { get; } = OutputPath.Combine("bin");
1717

18-
public string GitHubNuGetSource { get; } = System.Environment.GetEnvironmentVariable("GH_PACKAGES_NUGET_SOURCE");
19-
public string GitHubNuGetApiKey { get; } = System.Environment.GetEnvironmentVariable("GITHUB_TOKEN");
18+
public string? GitHubNuGetSource { get; } = System.Environment.GetEnvironmentVariable("GH_PACKAGES_NUGET_SOURCE");
19+
public string? GitHubNuGetApiKey { get; } = System.Environment.GetEnvironmentVariable("GITHUB_TOKEN");
2020

2121
public bool ShouldPushGitHubPackages() => (IsMainBranch || IsDevelopmentBranch) &&
2222
!string.IsNullOrWhiteSpace(GitHubNuGetSource)
2323
&& !string.IsNullOrWhiteSpace(GitHubNuGetApiKey);
2424

25-
public string NuGetSource { get; } = System.Environment.GetEnvironmentVariable("NUGET_SOURCE");
26-
public string NuGetApiKey { get; } = System.Environment.GetEnvironmentVariable("NUGET_APIKEY");
25+
public string? NuGetSource { get; } = System.Environment.GetEnvironmentVariable("NUGET_SOURCE");
26+
public string? NuGetApiKey { get; } = System.Environment.GetEnvironmentVariable("NUGET_APIKEY");
2727
public bool ShouldPushNuGetPackages() => IsMainBranch &&
2828
!string.IsNullOrWhiteSpace(NuGetSource) &&
2929
!string.IsNullOrWhiteSpace(NuGetApiKey);
@@ -37,4 +37,4 @@ public bool ShouldPushNuGetPackages() => IsMainBranch &&
3737
public DotNetMSBuildSettings MSBuildSettings => msBuildSettings ??= MSBuildSettingsCustomization(this, new DotNetMSBuildSettings());
3838
}
3939

40-
private record ExtensionHelper(Func<string, CakeTaskBuilder> TaskCreate, Func<CakeReport> Run);
40+
internal record ExtensionHelper(Func<string, CakeTaskBuilder> TaskCreate, Func<CakeReport> Run);

build.cake renamed to cake.cs

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
// Install .NET Core Global tools.
2-
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=6.5.0"
3-
4-
#load "build/records.cake"
5-
#load "build/helpers.cake"
1+
#:sdk Cake.Sdk@6.0.0
2+
#:property IncludeAdditionalFiles=./build/*.cs
63
74
/*****************************
85
* Setup
96
*****************************/
107
Setup(
118
static context => {
9+
InstallTool("dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=6.5.1");
10+
InstallTool("dotnet:https://api.nuget.org/v3/index.json?package=DPI&version=2025.12.17.349");
1211

1312
var assertedVersions = context.GitVersion(new GitVersionSettings
1413
{
1514
OutputType = GitVersionOutput.Json
1615
});
1716

18-
var gh = context.GitHubActions();
1917
var buildDate = DateTime.UtcNow;
20-
var runNumber = gh.IsRunningOnGitHubActions
21-
? gh.Environment.Workflow.RunNumber
18+
var runNumber = GitHubActions.IsRunningOnGitHubActions
19+
? GitHubActions.Environment.Workflow.RunNumber
2220
: (short)((buildDate - buildDate.Date).TotalSeconds/3);
2321
var version = FormattableString
2422
.Invariant($"{buildDate:yyyy.M.d}.{runNumber}");
@@ -63,7 +61,7 @@
6361
.WithProperty("PackageProjectUrl", "https://github.com/devlead/Devlead.Console.Template")
6462
.WithProperty("RepositoryUrl", "https://github.com/devlead/Devlead.Console.Template.git")
6563
.WithProperty("RepositoryType", "git")
66-
.WithProperty("ContinuousIntegrationBuild", gh.IsRunningOnGitHubActions ? "true" : "false")
64+
.WithProperty("ContinuousIntegrationBuild", GitHubActions.IsRunningOnGitHubActions ? "true" : "false")
6765
.WithProperty("EmbedUntrackedSources", "true")
6866
.WithProperty("PackageOutputPath", data.NuGetOutputPath.FullPath)
6967
.WithProperty("BaseOutputPath", data.BinaryOutputPath.FullPath + "/")
@@ -144,26 +142,22 @@
144142
.DeferOnError()
145143
.Then("DPI")
146144
.Does<BuildData>(
147-
static (context, data) => context.DotNetTool(
148-
"tool",
149-
new DotNetToolSettings {
150-
ArgumentCustomization = args => args
151-
.Append("run")
152-
.Append("dpi")
153-
.Append("nuget")
154-
.Append("--silent")
155-
.AppendSwitchQuoted("--output", "table")
156-
.Append(
157-
(
158-
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_SharedKey"))
159-
&&
160-
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_WorkspaceId"))
161-
)
162-
? "report"
163-
: "analyze"
164-
)
165-
.AppendSwitchQuoted("--buildversion", data.Version)
166-
}
145+
static (context, data) => Command(
146+
["dpi", "dpi.exe"],
147+
new ProcessArgumentBuilder()
148+
.Append("nuget")
149+
.Append("--silent")
150+
.AppendSwitchQuoted("--output", "table")
151+
.Append(
152+
(
153+
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_SharedKey"))
154+
&&
155+
!string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_WorkspaceId"))
156+
)
157+
? "report"
158+
: "analyze"
159+
)
160+
.AppendSwitchQuoted("--buildversion", data.Version)
167161
)
168162
)
169163
.Then("Pack")
@@ -180,10 +174,9 @@
180174
.Then("Upload-Artifacts")
181175
.WithCriteria(BuildSystem.IsRunningOnGitHubActions, nameof(BuildSystem.IsRunningOnGitHubActions))
182176
.Does<BuildData>(
183-
static (context, data) => context
184-
.GitHubActions()
185-
.Commands
186-
.UploadArtifact(data.ArtifactsPath, "artifacts")
177+
static (context, data) => GitHubActions
178+
.Commands
179+
.UploadArtifact(data.ArtifactsPath, "artifacts")
187180
)
188181
.Then("Push-GitHub-Packages")
189182
.WithCriteria<BuildData>( (context, data) => data.ShouldPushGitHubPackages())

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "10.0.100"
3+
"version": "10.0.101"
44
}
55
}

src/Devlead.Console.Template/DevleadConsole.Tests/DevleadConsole.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
<PrivateAssets>all</PrivateAssets>
2828
</PackageReference>
29-
<PackageReference Include="Devlead.Testing.MockHttp" Version="2025.11.25.508" />
29+
<PackageReference Include="Devlead.Testing.MockHttp" Version="2025.12.16.528" />
3030
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" Version="8.10.0" Condition="'$(TargetFramework)' == 'net8.0'" />
3131
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" Version="9.10.0" Condition="'$(TargetFramework)' == 'net9.0'" />
32-
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.0.0" Condition="'$(TargetFramework)' == 'net10.0'" />
32+
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.1.0" Condition="'$(TargetFramework)' == 'net10.0'" />
3333
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
3434
<PackageReference Include="NUnit" Version="4.4.0" />
3535
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
3636
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3737
<PrivateAssets>all</PrivateAssets>
3838
</PackageReference>
39-
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
39+
<PackageReference Include="NUnit3TestAdapter" Version="6.0.0" />
4040
<PackageReference Include="Spectre.Console.Testing" Version="0.54.0" />
41-
<PackageReference Include="verify.Nunit" Version="31.7.2" />
41+
<PackageReference Include="verify.Nunit" Version="31.9.0" />
4242
</ItemGroup>
4343

4444
</Project>

src/Devlead.Console.Template/DevleadConsole/DevleadConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Devlead.Console" Version="2025.11.25.507" />
18+
<PackageReference Include="Devlead.Console" Version="2025.12.17.530" />
1919
</ItemGroup>
2020

2121
</Project>

0 commit comments

Comments
 (0)