Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"nuke.globaltool": {
"version": "10.0.0",
"version": "10.1.0",
"commands": [
"nuke"
],
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
lfs: true
fetch-depth: 0
Expand All @@ -40,22 +40,22 @@ jobs:
CoverallsToken: ${{ secrets.COVERALLS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish: coverage.zip'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: coverage.zip
path: artifacts/coverage.zip
- name: 'Publish: Demo.Engine.zip'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: Demo.Engine.zip
path: artifacts/Demo.Engine.zip
- name: 'Publish: Demo.Engine.win-x64.zip'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: Demo.Engine.win-x64.zip
path: artifacts/Demo.Engine.win-x64.zip
- name: 'Publish: Demo.Engine.win-arm64.zip'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: Demo.Engine.win-arm64.zip
path: artifacts/Demo.Engine.win-arm64.zip
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="Nuke.Common" Version="10.0.0" />
<PackageVersion Include="Nuke.Common" Version="10.1.0" />
<PackageVersion Include="ReportGenerator" Version="5.5.0" />
<PackageVersion Include="coveralls.net" Version="4.0.1" />
</ItemGroup>
Expand Down
27 changes: 10 additions & 17 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ var nuke when nuke.TryGetValue("NUKE_RUN_ID", out var nukeid) => nukeid,
_ => null
};

[Solution] public readonly Solution Solution = default!;
[Solution(GenerateProjects = true)] public readonly Solution Solution = default!;
[GitRepository] private readonly GitRepository _gitRepository = default!;

private GitVersion _gitVersion = default!;

private static AbsolutePath SourceDirectory => RootDirectory / "src";
private static AbsolutePath TestDirectory => RootDirectory / "test";
private static AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
private Project[] TestProjects => Solution.GetAllProjects("*.UTs").ToArray();
private Project[] TestProjects => [.. Solution.test.Projects];

//private const string MASTER_BRANCH = "master";
private const string DEVELOP_BRANCH = "develop";
Expand Down Expand Up @@ -287,7 +287,7 @@ protected override void OnBuildInitialized()
{
//A runtime dependant version is also currently generated by default and exposed to CI artifacts
PublishApp(
projectName: "Demo.Engine");
Solution.src.Demo_Engine);

//We generate a self contained, "one file", trimmed version for Windows x64 by default
//Any other can be generated as well, but aren't currently supported so aren't exposed to CI artifacts
Expand All @@ -300,7 +300,7 @@ protected override void OnBuildInitialized()
foreach (var rid in rids)
{
PublishApp(
projectName: "Demo.Engine",
Solution.src.Demo_Engine,
rid: rid);
}
});
Expand Down Expand Up @@ -346,30 +346,23 @@ protected override void OnBuildInitialized()
);
});

private void PublishApp(string projectName, string? rid = null, bool zipProject = true)
private void PublishApp(Project project, string? rid = null, bool zipProject = true)
{
AbsolutePath outputDir;
if (string.IsNullOrEmpty(rid))
{
outputDir = ArtifactsDirectory / projectName;
Log.Information($"Publishing {projectName} into {outputDir}");
outputDir = ArtifactsDirectory / project.Name;
Log.Information($"Publishing {project.Name} into {outputDir}");
}
else
{
outputDir = ArtifactsDirectory / $"{projectName}.{rid}";
Log.Information($"Publishing {projectName} for {rid} into {outputDir}");
outputDir = ArtifactsDirectory / $"{project.Name}.{rid}";
Log.Information($"Publishing {project.Name} for {rid} into {outputDir}");
}

_ = DotNetPublish(t => t
.SetProject(
/* This doesn't work, because Demo.Engine is in a solution folder
* And Solution.GetProject only searches through projects that are directly in the Solution
* */
//Solution.GetProject(projectName))
v: Solution
.AllProjects
.Single(project
=> project.Name.Equals(projectName, StringComparison.Ordinal)))
v: project)
.SetConfiguration(Configuration)
//.SetProperty("Platform", platform)
.SetAssemblyVersion(_gitVersion.AssemblySemVer)
Expand Down