Skip to content

Upgrade targets to .NET 8/.NET 10, refresh MQTTnet packages, and add GitHub Actions CI/publish workflows#18

Merged
maikebing merged 2 commits into
masterfrom
copilot/update-target-frameworks-and-ci
Apr 18, 2026
Merged

Upgrade targets to .NET 8/.NET 10, refresh MQTTnet packages, and add GitHub Actions CI/publish workflows#18
maikebing merged 2 commits into
masterfrom
copilot/update-target-frameworks-and-ci

Conversation

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown

This updates the library to target .NET 8 and .NET 10, moves the examples/tests to .NET 10, upgrades MQTTnet dependencies to the latest 5.1.* line, and replaces the existing external build badge with repository-native GitHub Actions. It also adds first-party CI and release workflows for branch/PR validation and package publishing to both NuGet.org and GitHub Packages.

  • Framework and package baseline

    • Change the library target frameworks from net9.0;net8.0 to net8.0;net10.0
    • Move ExampleClient, ExampleServer, and test project targets to net10.0
    • Upgrade MQTTnet dependencies to floating 5.1.* patch versions
    • Include the repository README in the NuGet package metadata to remove package authoring warnings
  • Warning cleanup

    • Enable nullable context consistently where nullable annotations were already used
    • Tighten null handling around route invocation and assembly discovery
    • Remove remaining compile-time/package warnings exposed by the framework/package updates
  • GitHub Actions

    • Add ci.yml to build on all branch pushes and pull requests
    • Add publish.yml to pack and publish on release or manual dispatch
    • Publish packages to:
      • NuGet.org via organization secret NUGET_API_KEY
      • GitHub Packages via GITHUB_TOKEN
    • Scope workflow permissions explicitly
  • Docs and repository metadata

    • Replace the old AppVeyor badge with a GitHub Actions CI badge
    • Update supported framework documentation to reflect .NET 8 and .NET 10

Example of the updated package targeting/version policy:

<PropertyGroup>
  <TargetFrameworks>net8.0;net10.0</TargetFrameworks>
  <PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="MQTTnet" Version="5.1.*" />
  <PackageReference Include="MQTTnet.AspNetCore" Version="5.1.*" />
</ItemGroup>

Copilot AI and others added 2 commits April 17, 2026 20:52
@maikebing maikebing marked this pull request as ready for review April 18, 2026 10:27
Copilot AI review requested due to automatic review settings April 18, 2026 10:27
@maikebing maikebing merged commit 801f2cc into master Apr 18, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the library and its companion projects to newer .NET target frameworks, refreshes MQTTnet dependencies, and introduces first-party GitHub Actions workflows for CI and package publishing.

Changes:

  • Retarget projects to net8.0/net10.0 (library multi-targeted; examples/tests moved to net10.0).
  • Update MQTTnet package references to the 5.1.* line and include README.md in NuGet package metadata.
  • Add GitHub Actions CI and Publish workflows and replace the AppVeyor badge with a GitHub Actions badge.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Tests/MQTTnet.AspNetCore.Routing.Tests/MQTTnet.AspNetCore.Routing.Tests.csproj Retarget tests to net10.0.
Source/Routing/MqttRouter.cs Tighten null handling and improve error messages during handler invocation/parameter assignment.
Source/MQTTnet.AspNetCore.Routing.csproj Switch TFMs to net8.0;net10.0, float MQTTnet deps to 5.1.*, and pack README.
Source/Extensions/ServiceCollectionExtensions.cs Enable nullable context and harden assembly discovery fallback.
README.md Swap build badge to GitHub Actions and update supported framework list.
ExampleServer/ExampleServer.csproj Retarget example server to net10.0.
ExampleClient/ExampleClient.csproj Retarget example client to net10.0 and float MQTTnet dependency.
.github/workflows/publish.yml Add release/manual publish workflow (build/test/pack/push).
.github/workflows/ci.yml Add CI workflow for restore/build/test on pushes and PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +41
<PackageReference Include="MQTTnet" Version="5.1.*" />
<PackageReference Include="MQTTnet.AspNetCore" Version="5.1.*" />
@@ -49,7 +51,7 @@ public static IServiceCollection AddMqttControllers(this IServiceCollection serv
{
throw new ArgumentException("'fromAssemblies' cannot be an empty array. Pass null or a collection of 1 or more assemblies.", nameof(fromAssemblies));
}
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push "${{ github.workspace }}/artifacts/*.nupkg" --api-key "$GITHUB_TOKEN" --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate

<ItemGroup>
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
<PackageReference Include="MQTTnet" Version="5.1.*" />
@maikebing maikebing deleted the copilot/update-target-frameworks-and-ci branch April 18, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants