Skip to content

Commit

Permalink
feature/net6 (#368)
Browse files Browse the repository at this point in the history
* Updated to net6 sdk

* Removed jetbrains tools
  • Loading branch information
david-driscoll authored Oct 14, 2021
1 parent 711a2b3 commit 46b531b
Show file tree
Hide file tree
Showing 23 changed files with 764 additions and 740 deletions.
10 changes: 3 additions & 7 deletions .build/.build.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" />
<PackageReference Include="JetBrains.ReSharper.GlobalTools" ExcludeAssets="All" />
<PackageReference Include="GitVersion.Tool" ExcludeAssets="All" />
<PackageReference Include="ReportGenerator" ExcludeAssets="All" />
<PackageReference Include="Rocket.Surgery.Nuke" />
Expand All @@ -22,5 +19,4 @@
<NukeExternalFiles Include="**\*.*.ext" Exclude="bin\**;obj\**" />
<None Remove="*.csproj.DotSettings;*.ref.*.txt" />
</ItemGroup>

</Project>
</Project>
141 changes: 75 additions & 66 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
using Rocket.Surgery.Nuke.DotNetCore;
using Rocket.Surgery.Nuke.GithubActions;


[GitHubActionsSteps("ci", GitHubActionsImage.MacOsLatest, GitHubActionsImage.WindowsLatest, GitHubActionsImage.UbuntuLatest,
[GitHubActionsSteps(
"ci",
GitHubActionsImage.MacOsLatest,
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
On = new[] { GitHubActionsTrigger.Push },
OnPushTags = new[] { "v*" },
Expand All @@ -27,7 +30,9 @@
ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) },
Enhancements = new[] { nameof(Middleware) }
)]
[PrintBuildVersion, PrintCIEnvironment, UploadLogs]
[PrintBuildVersion]
[PrintCIEnvironment]
[UploadLogs]
public partial class Solution
{
public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGitHubActionsConfiguration configuration)
Expand All @@ -36,76 +41,80 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi
var checkoutStep = buildJob.Steps.OfType<CheckoutStep>().Single();
// For fetch all
checkoutStep.FetchDepth = 0;
buildJob.Steps.InsertRange(buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] {
new RunStep("Fetch all history for all tags and branches") {
Run = "git fetch --prune"
},
new SetupDotNetStep("Use .NET Core 2.1 SDK") {
DotNetVersion = "2.1.x"
},
new SetupDotNetStep("Use .NET Core 3.1 SDK") {
DotNetVersion = "3.1.x"
},
new SetupDotNetStep("Use .NET Core 5.0 SDK") {
DotNetVersion = "5.0.x"
},
});

buildJob.Steps.Add(new UsingStep("Publish Coverage")
{
Uses = "codecov/codecov-action@v1",
With = new Dictionary<string, string>
buildJob.Steps.InsertRange(
buildJob.Steps.IndexOf(checkoutStep) + 1,
new BaseGitHubActionsStep[]
{
["name"] = "actions-${{ matrix.os }}",
new RunStep("Fetch all history for all tags and branches")
{
Run = "git fetch --prune"
},
new SetupDotNetStep("Use .NET Core 2.1 SDK")
{
DotNetVersion = "2.1.x"
},
new SetupDotNetStep("Use .NET Core 3.1 SDK")
{
DotNetVersion = "3.1.x"
},
new SetupDotNetStep("Use .NET Core 5.0 SDK")
{
DotNetVersion = "5.0.x"
},
new SetupDotNetStep("Use .NET Core 6.0 SDK")
{
DotNetVersion = "6.0.x"
},
}
});

buildJob.Steps.Add(new UploadArtifactStep("Publish logs")
{
Name = "logs",
Path = "artifacts/logs/",
If = "always()"
});

buildJob.Steps.Add(new UploadArtifactStep("Publish coverage data")
{
Name = "coverage",
Path = "coverage/",
If = "always()"
});
);

buildJob.Steps.Add(new UploadArtifactStep("Publish test data")
{
Name = "test data",
Path = "artifacts/test/",
If = "always()"
});

buildJob.Steps.Add(new UploadArtifactStep("Publish NuGet Packages")
{
Name = "nuget",
Path = "artifacts/nuget/",
If = "always()"
});
buildJob.Steps.Add(
new UsingStep("Publish Coverage")
{
Uses = "codecov/codecov-action@v1",
With = new Dictionary<string, string>
{
["name"] = "actions-${{ matrix.os }}",
}
}
);

buildJob.Steps.Add(
new UploadArtifactStep("Publish logs")
{
Name = "logs",
Path = "artifacts/logs/",
If = "always()"
}
);

/*
buildJob.Steps.Add(
new UploadArtifactStep("Publish coverage data")
{
Name = "coverage",
Path = "coverage/",
If = "always()"
}
);

- publish: "${{ parameters.Artifacts }}/logs/"
displayName: Publish Logs
artifact: "Logs${{ parameters.Postfix }}"
condition: always()
buildJob.Steps.Add(
new UploadArtifactStep("Publish test data")
{
Name = "test data",
Path = "artifacts/test/",
If = "always()"
}
);

- publish: ${{ parameters.Coverage }}
displayName: Publish Coverage
artifact: "Coverage${{ parameters.Postfix }}"
condition: always()
buildJob.Steps.Add(
new UploadArtifactStep("Publish NuGet Packages")
{
Name = "nuget",
Path = "artifacts/nuget/",
If = "always()"
}
);

- publish: "${{ parameters.Artifacts }}/nuget/"
displayName: Publish NuGet Artifacts
artifact: "NuGet${{ parameters.Postfix }}"
condition: always()
*/
return configuration;
}
}
}
34 changes: 17 additions & 17 deletions .build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.Tools.DotNet;
Expand All @@ -16,23 +14,24 @@
[UnsetVisualStudioEnvironmentVariables]
[PackageIcon("https://raw.githubusercontent.com/RocketSurgeonsGuild/graphics/master/png/social-square-thrust-rounded.png")]
[EnsureGitHooks(GitHook.PreCommit)]
[EnsureReadmeIsUpdated]
[EnsureReadmeIsUpdated("Readme.md")]
[DotNetVerbosityMapping]
[MSBuildVerbosityMapping]
[NuGetVerbosityMapping]
[ShutdownDotNetAfterServerBuild]
public partial class Solution : NukeBuild,
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
ICanPackWithDotNetCore,
IHaveDataCollector,
ICanClean,
ICanUpdateReadme,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
IHaveConfiguration<Configuration>,
ICanLint
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
ICanPackWithDotNetCore,
IHaveDataCollector,
ICanClean,
ICanUpdateReadme,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
IHaveConfiguration<Configuration>,
ICanLint
{
/// <summary>
/// Support plugins are available for:
Expand Down Expand Up @@ -61,6 +60,7 @@ public partial class Solution : NukeBuild,
public GitVersion GitVersion { get; } = null!;

public Target Clean => _ => _.Inherit<ICanClean>(x => x.Clean);
public Target Lint => _ => _.Inherit<ICanLint>(x => x.Lint);
public Target Restore => _ => _.Inherit<ICanRestoreWithDotNetCore>(x => x.CoreRestore);
public Target Test => _ => _.Inherit<ICanTestWithDotNetCore>(x => x.CoreTest);

Expand All @@ -70,4 +70,4 @@ public partial class Solution : NukeBuild,

[Parameter("Configuration to build")]
public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
}
}
66 changes: 32 additions & 34 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-outdated": {
"version": "2.11.0",
"commands": [
"dotnet-outdated"
]
},
"gitversion.tool": {
"version": "5.6.9",
"commands": [
"dotnet-gitversion"
]
},
"dotnet-reportgenerator-globaltool": {
"version": "4.8.8",
"commands": [
"reportgenerator"
]
},
"nuke.globaltool": {
"version": "5.1.1",
"commands": [
"nuke"
]
},
"codecov.tool": {
"version": "1.13.0",
"commands": [
"codecov"
]
"version": 1,
"isRoot": true,
"tools": {
"dotnet-outdated": {
"version": "2.11.0",
"commands": ["dotnet-outdated"]
},
"gitversion.tool": {
"version": "5.6.8",
"commands": ["dotnet-gitversion"]
},
"dotnet-reportgenerator-globaltool": {
"version": "4.8.7",
"commands": ["reportgenerator"]
},
"nuke.globaltool": {
"version": "5.2.1",
"commands": ["nuke"]
},
"codecov.tool": {
"version": "1.13.0",
"commands": ["codecov"]
},
"jetbrains.resharper.globaltools": {
"version": "2021.3.0-eap02",
"commands": ["jb"]
},
"dotnet-format": {
"version": "5.1.225507",
"commands": ["dotnet-format"]
}
}
}
}
}
Loading

0 comments on commit 46b531b

Please sign in to comment.