Skip to content

Commit

Permalink
GitTools#3166 - drop .net core 3.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Oct 5, 2022
1 parent 9d66835 commit be08e98
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 113 deletions.
9 changes: 3 additions & 6 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ pull_request_rules:
- '#commits-behind=0' # Only merge up to date pull requests
- check-success=DotNet Format
- check-success=Release
- check-success=Unit Test code (windows-latest, netcoreapp3.1)
- check-success=Unit Test code (ubuntu-latest, netcoreapp3.1)
- check-success=Unit Test code (macos-latest, netcoreapp3.1)
- check-success=Unit Test code (windows-latest, net5.0)
- check-success=Unit Test code (windows-latest, net5.0)
- check-success=Unit Test code (windows-latest, net5.0)
- check-success=Unit Test code (windows-latest, net6.0)
- check-success=Unit Test code (windows-latest, net6.0)
- check-success=Unit Test code (windows-latest, net6.0)
- repository-full-name=GitTools/GitVersion # Don't auto-merge PRs in forks
actions:
merge:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
targetFramework: [net6.0, netcoreapp3.1]
exclude:
- os: macos-latest
targetFramework: netcoreapp3.1
targetFramework: [net6.0]
fail-fast: false

steps:
Expand Down Expand Up @@ -227,7 +224,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '6.0' ]
targetFramework: [ '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
fail-fast: false

Expand Down Expand Up @@ -291,7 +288,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '6.0' ]
targetFramework: [ '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
fail-fast: false

Expand Down
4 changes: 2 additions & 2 deletions build/.run/Default Artifacts.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Default Artifacts" type="DotNetProject" factoryName=".NET Project" folderName="Default">
<option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts-test.exe" />
<option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." />
<option name="PASS_PARENT_ENVS" value="1" />
Expand All @@ -17,4 +17,4 @@
<option name="Build" />
</method>
</configuration>
</component>
</component>
20 changes: 0 additions & 20 deletions build/.run/UnitTest (3.1).run.xml

This file was deleted.

20 changes: 0 additions & 20 deletions build/.run/UnitTest (4.8).run.xml

This file was deleted.

2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsDotnetToolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsDotnetToolTest))]
[TaskDescription("Tests the dotnet global tool in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsDotnetToolTest : FrostingTask<BuildContext>
Expand Down
4 changes: 1 addition & 3 deletions build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsMsBuildCoreTest))]
[TaskDescription("Tests the msbuild package in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsMsBuildCoreTest : FrostingTask<BuildContext>
Expand All @@ -32,10 +32,8 @@ public override void Run(BuildContext context)
string distro = dockerImage.Distro;
string targetFramework = dockerImage.TargetFramework;

if (targetFramework == Constants.Version31 && distro == Constants.Centos8) continue; // TODO check why this one fails
targetFramework = targetFramework switch
{
Constants.Version31 => $"netcoreapp{targetFramework}",
Constants.Version60 => $"net{targetFramework}",
_ => targetFramework
};
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void Run(BuildContext context)
var nugetSource = context.MakeAbsolute(Paths.Nuget).FullPath;

context.Information("\nTesting msbuild task with dotnet build (for .net core)\n");
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
var frameworks = new[] { Constants.NetVersion60 };
foreach (var framework in frameworks)
{
var dotnetMsBuildSettings = new DotNetMSBuildSettings();
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsNativeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsNativeTest))]
[TaskDescription("Tests the native executables in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsNativeTest : FrostingTask<BuildContext>
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsPrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsPrepare))]
[TaskDescription("Pulls the docker images needed for testing the artifacts")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
public class ArtifactsPrepare : FrostingTask<BuildContext>
{
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsTest))]
[TaskDescription("Tests packages in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsNativeTest))]
[IsDependentOn(typeof(ArtifactsDotnetToolTest))]
Expand Down
4 changes: 2 additions & 2 deletions build/build/Tasks/Test/UnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Build.Tasks;

[TaskName(nameof(UnitTest))]
[TaskDescription("Run the unit tests")]
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60, Constants.CoreFxVersion31)]
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60)]
[IsDependentOn(typeof(Build))]
public class UnitTest : FrostingTask<BuildContext>
{
Expand All @@ -17,7 +17,7 @@ public class UnitTest : FrostingTask<BuildContext>
public override void Run(BuildContext context)
{
var dotnetTarget = context.Argument(Arguments.DotnetTarget, string.Empty);
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
var frameworks = new[] { Constants.NetVersion60 };
if (!string.IsNullOrWhiteSpace(dotnetTarget))
{
if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase))
Expand Down
4 changes: 1 addition & 3 deletions build/common/Utilities/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ public class Constants
public const string Repository = "GitVersion";

public const string Version60 = "6.0";
public const string Version31 = "3.1";

public const string NetVersion60 = "net6.0";
public const string CoreFxVersion31 = "netcoreapp3.1";

public static readonly string[] VersionsToBuild = { Version60, Version31 };
public static readonly string[] VersionsToBuild = { Version60 };
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };
public static readonly string[] DistrosToSkip = { Alpine312, Alpine313, Alpine314, Centos7 };

Expand Down
3 changes: 0 additions & 3 deletions build/common/Utilities/DockerContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public static bool SkipImage(this ICakeContext context, DockerImage dockerImage)
{
var (distro, targetFramework, architecture, _, _) = dockerImage;

// TODO skip this because of https://github.com/GitTools/GitVersion/pull/3148, remove after .net core 3.1 is removed
if (distro == Constants.Ubuntu2204 && targetFramework == Constants.Version31) return true;

if (architecture != Architecture.Arm64) return false;
if (!Constants.DistrosToSkip.Contains(distro)) return false;

Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerBuild))]
[TaskDescription("Build the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
public class DockerBuild : FrostingTask<BuildContext>
Expand Down
5 changes: 1 addition & 4 deletions build/docker/Tasks/DockerManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerManifest))]
[TaskDescription("Publish the docker manifest containing the images for amd64 and arm64")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(DockerManifestInternal))]
public class DockerManifest : FrostingTask<BuildContext>
Expand Down Expand Up @@ -44,9 +44,6 @@ public override void Run(BuildContext context)
{
foreach (var group in context.Images.GroupBy(x => new { x.Distro, x.TargetFramework }))
{
// TODO skip this because of https://github.com/GitTools/GitVersion/pull/3148, remove after .net core 3.1 is removed
if (group.Key.Distro == Constants.Ubuntu2204 && group.Key.TargetFramework == Constants.Version31) continue;

var amd64DockerImage = group.First(x => x.Architecture == Architecture.Amd64);
var arm64DockerImage = group.First(x => x.Architecture == Architecture.Arm64);
context.DockerCreateManifest(amd64DockerImage, context.SkipImage(arm64DockerImage));
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerPublish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerPublish))]
[TaskDescription("Publish the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
[IsDependentOn(typeof(DockerPublishInternal))]
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerTest))]
[TaskDescription("Test the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
[IsDependentOn(typeof(DockerBuild))]
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/GitVersion.App.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App/GitVersion.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>GitVersion</RootNamespace>
<AssemblyName>gitversion</AssemblyName>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>

<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
Loading

0 comments on commit be08e98

Please sign in to comment.