Skip to content

Commit

Permalink
Updates for .NET 8 - release-7.0 (#1411)
Browse files Browse the repository at this point in the history
* Updates for .NET 8

* Fixups

* Azure login & upload-artifact fixes

---------

Co-authored-by: internalautomation[bot] <85681268+internalautomation[bot]@users.noreply.github.com>
Co-authored-by: David Boike <david.boike@gmail.com>
  • Loading branch information
3 people committed Mar 11, 2024
1 parent b610ee0 commit c750412
Show file tree
Hide file tree
Showing 29 changed files with 120 additions and 81 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- os: windows-2019
os-name: Windows
- os: ubuntu-20.04
os-name: Linux
os-name: Linux
fail-fast: false
steps:
- name: Check for secrets
Expand All @@ -30,25 +30,27 @@ jobs:
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: |
6.0.x
8.0.x
7.0.x
6.0.x
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
if: matrix.name == 'Windows-SqlServer'
with:
name: NuGet packages
path: nugets/
retention-days: 7
- name: Azure login
uses: azure/login@v1.4.5
uses: azure/login@v2.0.0
if: matrix.engine == 'PostgreSQL' || (matrix.engine == 'Oracle' && matrix.os-name == 'Windows')
with:
creds: ${{ secrets.AZURE_ACI_CREDENTIALS }}
Expand Down Expand Up @@ -161,7 +163,7 @@ jobs:
"OracleConnectionString=$($connectionString.Replace('system', 'particular'))" >> $Env:GITHUB_ENV
"OracleConnectionString_Particular2=$($connectionString.Replace('system', 'particular2'))" >> $Env:GITHUB_ENV
- name: Run tests
uses: Particular/run-tests-action@v1.6.0
uses: Particular/run-tests-action@v1.7.0
- name: Teardown infrastructure
if: ${{ always() }}
shell: pwsh
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: windows-2019 # Windows required for ILMerge to work in ScriptBuilderTask
steps:
- name: Checkout
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand All @@ -28,12 +28,13 @@ jobs:
client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}
- name: Publish artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.3.1
with:
name: nugets
path: nugets/*
retention-days: 1
- name: Deploy
uses: Particular/push-octopus-package-action@v1.0.0
# Does not follow standard practice of targeting explicit versions because configuration is tightly coupled to Octopus Deploy configuration
uses: Particular/push-octopus-package-action@main
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
2 changes: 1 addition & 1 deletion src/AcceptanceTestHelper/AcceptanceTestHelper.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/AcceptanceTestHelper/RuntimeSagaDefinitionReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using Mono.Cecil;
using NServiceBus;
using NServiceBus.Persistence.Sql;
Expand Down Expand Up @@ -40,7 +40,11 @@ public static SagaDefinition GetSagaDefinition(Type sagaType, BuildSqlDialect sq
throw new Exception("Saga implementations must inherit from either Saga<T> or SqlSaga<T> directly. Deep class hierarchies are not supported.");
}

var saga = (Saga)FormatterServices.GetUninitializedObject(sagaType);
#if NETFRAMEWORK
var saga = (Saga)System.Runtime.Serialization.FormatterServices.GetUninitializedObject(sagaType);
#else
var saga = (Saga)RuntimeHelpers.GetUninitializedObject(sagaType);
#endif
var mapper = new ConfigureHowToFindSagaWithMessage();
methodInfo.Invoke(saga, new object[]
{
Expand Down
3 changes: 3 additions & 0 deletions src/AcceptanceTestsShared/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
3 changes: 3 additions & 0 deletions src/MsSqlMicrosoftDataClientAcceptanceTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
<RootNamespace>MsSqlAcceptanceTests</RootNamespace>
Expand All @@ -12,10 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -11,19 +11,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.Transport.SqlServer" Version="7.0.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\EndpointTemplates\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\ScenarioDescriptors\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\NServiceBusAcceptanceTest.cs" />
<!-- Referencing net472 versions for all test frameworks because NServiceBus.AcceptanceTests.Sources doesn't include sources for net8.0 and they're all the same -->
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\EndpointTemplates\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\ScenarioDescriptors\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\NServiceBusAcceptanceTest.cs" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/MsSqlSystemDataClientAcceptanceTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
<RootNamespace>MsSqlAcceptanceTests</RootNamespace>
Expand All @@ -12,10 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ dotnet_diagnostic.NSB0013.severity = none
dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -11,19 +11,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.SqlServer" Version="7.0.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\EndpointTemplates\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\ScenarioDescriptors\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\$(TargetFramework)\**\NServiceBusAcceptanceTest.cs" />
<!-- Referencing net472 versions for all test frameworks because NServiceBus.AcceptanceTests.Sources doesn't include sources for net8.0 and they're all the same -->
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\EndpointTemplates\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\ScenarioDescriptors\*.cs" />
<Compile Include="$(PkgNServiceBus_AcceptanceTests_Sources)\contentFiles\cs\net472\**\NServiceBusAcceptanceTest.cs" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/MySqlAcceptanceTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
8 changes: 4 additions & 4 deletions src/MySqlAcceptanceTests/MySqlAcceptanceTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -11,10 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions src/OracleAcceptanceTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
8 changes: 4 additions & 4 deletions src/OracleAcceptanceTests/OracleAcceptanceTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -11,10 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions src/PostgreSqlAcceptanceTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dotnet_diagnostic.NSB0014.severity = none
dotnet_diagnostic.NSB0015.severity = none
dotnet_diagnostic.NSB0016.severity = none
dotnet_diagnostic.NSB0017.severity = none

# IDE0028: Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = suggestion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -11,10 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.0.5" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -13,10 +13,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.SqlServer.DACFx" Version="160.6161.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.3.0" />
<PackageReference Include="PublicApiGenerator" Version="10.3.0" />
Expand Down
Loading

0 comments on commit c750412

Please sign in to comment.