diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 119f4df92..2e0d6f67b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -42,10 +42,15 @@ jobs: with: fetch-depth: 0 # all - - name: Setup .NET 8.0 + # At the moment we build using the net10 toolchain but test on net462, net48 and net80. + # We publish packages for net462, net48 and net80 + # The Tests run on net10 as part of the Octopus Server build pipeline separately. + - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 10.0.x - name: Append OCTOVERSION_CurrentBranch with -nightly (for scheduled) if: github.event_name == 'schedule' @@ -149,12 +154,14 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Setup .NET 8 + - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 10.0.x - - name: Run unit tests 🏗 + - name: Run unit tests (net8.0) 🏗 shell: bash run: dotnet test ./source/Octopus.Client.Tests/Octopus.Client.Tests.csproj --framework net8.0 --configuration:Release --logger:"trx;LogFilePrefix=Linux" --results-directory ./TestResults diff --git a/build/Build.cs b/build/Build.cs index a7d96f2e9..b23079924 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -163,6 +163,7 @@ class Build : NukeBuild .SetProjectFile(testProjectFile) .SetConfiguration(Configuration) .EnableNoBuild() + .AddProcessAdditionalArguments("/m:1") // force msbuild to only spawn one process at a time, which stops the tests running in parallel (HttpIntegrationTestBase hardcodes a TCP port number so must run sequentially) .SetLoggers("trx;LogFilePrefix=Win") .SetResultsDirectory("./TestResults/")); }); @@ -210,11 +211,7 @@ class Build : NukeBuild DotNetPack(_ => _ .SetProject(OctopusClientFolder) - .SetProcessArgumentConfigurator(args => - { - args.Add($"/p:NuspecFile=Octopus.Client.nuspec"); - return args; - }) + .SetProcessAdditionalArguments("/p:NuspecFile=Octopus.Client.nuspec") .SetVersion(FullSemVer) .SetConfiguration(Configuration) .SetOutputDirectory(ArtifactsDir) @@ -361,12 +358,11 @@ void SignWithAzureSignTool(AbsolutePath[] files, string timestampUrl) .SetFiles(files.Select(x => x.ToString()))); } + // Note: this only works on Windows void SignWithSignTool(AbsolutePath[] files, string url) { Log.Information("Signing files using signtool."); - SignToolLogger = LogStdErrAsWarning; - SignTool(_ => _ .SetFile(SigningCertificatePath) .SetPassword(SigningCertificatePassword) diff --git a/build/_build.csproj b/build/_build.csproj index 94be472cc..3797192e6 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,14 +2,12 @@ Exe - net8.0 + net10.0 CS0649;CS0169 .. .. 1 - - true @@ -17,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/global.json b/global.json index 391ba3c2a..067010d79 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "10.0.102", "rollForward": "latestFeature" } } diff --git a/source/Octopus.Client.E2ETests/Octopus.Client.E2ETests.csproj b/source/Octopus.Client.E2ETests/Octopus.Client.E2ETests.csproj index 8e7a3bf13..dd89b4ece 100644 --- a/source/Octopus.Client.E2ETests/Octopus.Client.E2ETests.csproj +++ b/source/Octopus.Client.E2ETests/Octopus.Client.E2ETests.csproj @@ -11,11 +11,11 @@ - net8.0 + net10.0 - net8.0;net462;net48 + net10.0;net8.0;net462;net48 diff --git a/source/Octopus.Client.E2ETests/TestHelpers.cs b/source/Octopus.Client.E2ETests/TestHelpers.cs index 6bb9139b0..b3fd938bd 100644 --- a/source/Octopus.Client.E2ETests/TestHelpers.cs +++ b/source/Octopus.Client.E2ETests/TestHelpers.cs @@ -21,7 +21,7 @@ internal static string GetNuGetPackage() internal static string GetRuntime() { var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().FullLocalPath()); - var runtime = Regex.Replace(new DirectoryInfo(path).Name, @"net\d\.\d", "netstandard2.0"); + var runtime = Regex.Replace(new DirectoryInfo(path).Name, @"net\d+\.\d+", "netstandard2.0"); return runtime; } } diff --git a/source/Octopus.Client.Tests/Integration/HttpIntegrationTestBase.cs b/source/Octopus.Client.Tests/Integration/HttpIntegrationTestBase.cs index 2e2e867a8..992705c08 100644 --- a/source/Octopus.Client.Tests/Integration/HttpIntegrationTestBase.cs +++ b/source/Octopus.Client.Tests/Integration/HttpIntegrationTestBase.cs @@ -87,9 +87,9 @@ private static X509Certificate2 GetCert() using (var ms = new MemoryStream()) { s.CopyTo(ms); -#pragma warning disable PC001 +#pragma warning disable SYSLIB0057 // Use X509CertificateLoader instead of new X509Certificate2 return new X509Certificate2(ms.ToArray(), "password"); -#pragma warning restore PC001 +#pragma warning restore SYSLIB0057 } } diff --git a/source/Octopus.Client.Tests/Octopus.Client.Tests.csproj b/source/Octopus.Client.Tests/Octopus.Client.Tests.csproj index bff40c03c..5e559a978 100644 --- a/source/Octopus.Client.Tests/Octopus.Client.Tests.csproj +++ b/source/Octopus.Client.Tests/Octopus.Client.Tests.csproj @@ -14,11 +14,11 @@ - net8.0 + net10.0 - net8.0;net462;net48 + net10.0;net8.0;net462;net48 @@ -26,7 +26,7 @@ win7-x86 - + $(DefineConstants);HTTP_CLIENT_SUPPORTS_SSL_OPTIONS @@ -44,9 +44,9 @@ - - - + + +