Skip to content
Closed
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
17 changes: 12 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
10 changes: 3 additions & 7 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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/"));
});
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<!-- NET8: Remove this when Nuke releases a new version which sets it for us -->
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nuke.Common" Version="8.1.4" />
<PackageReference Include="Nuke.Common" Version="10.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "10.0.102",
"rollForward": "latestFeature"
}
}
4 changes: 2 additions & 2 deletions source/Octopus.Client.E2ETests/Octopus.Client.E2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</PropertyGroup>
<!-- `dotnet publish` can only build one target at at time. -->
<PropertyGroup Condition="'$(_IsPublishing)' == 'True'">
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<!-- `dotnet build` can build all targets -->
<PropertyGroup Condition="'$(_IsPublishing)' != 'True'">
<TargetFrameworks>net8.0;net462;net48</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;net462;net48</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Octopus.Client\Octopus.Client.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion source/Octopus.Client.E2ETests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
12 changes: 6 additions & 6 deletions source/Octopus.Client.Tests/Octopus.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

<!-- `dotnet publish` can only build one target at at time. -->
<PropertyGroup Condition="'$(_IsPublishing)' == 'True'">
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<!-- `dotnet build` can build all targets -->
<PropertyGroup Condition="'$(_IsPublishing)' != 'True'">
<TargetFrameworks>net8.0;net462;net48</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;net462;net48</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net48' ">
<RuntimeIdentifier>win7-x86</RuntimeIdentifier> <!-- So that libuv is copied correctly -->
<BaseNuGetRuntimeIdentifier>win7-x86</BaseNuGetRuntimeIdentifier> <!-- So that libuv is copied correctly -->
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net10.0' ">
<DefineConstants>$(DefineConstants);HTTP_CLIENT_SUPPORTS_SSL_OPTIONS</DefineConstants>
</PropertyGroup>

Expand All @@ -44,9 +44,9 @@
<PackageReference Include="Nancy" Version="2.0.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Owin" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Owin" Version="2.3.9" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.3.9" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.3.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.2" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="10.0.2" />
<PackageReference Include="Best.Conventional" Version="12.0.0" />
Expand Down