Skip to content

Commit

Permalink
Support net7.0 (#177)
Browse files Browse the repository at this point in the history
* add net7.0 to TargetFrameworks in Tmds.DBus.Tool

* update SDK in github workflow

* update the tests projects

* Remove .NET Core 3.1 (EOL) target for Tool.

---------

Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
  • Loading branch information
hansmbakker and tmds committed Feb 14, 2023
1 parent f1f2b4d commit bacf5e5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 49 deletions.
91 changes: 45 additions & 46 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build
on: [push, pull_request ]
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
Expand All @@ -9,48 +9,47 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

steps:
- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Install reportgenerator tool
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Fetch sources
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run tests
run: |
pushd test/Tmds.DBus.Tests && dotnet test && popd
pushd test/Tmds.DBus.Protocol.Tests && dotnet test --collect:"XPlat Code Coverage" && popd
- name: Build tool
run: |
pushd src/Tmds.DBus.Tool && dotnet build && popd
- name: Build packages
run: |
VERSION_SUFFIX="${{ github.run_number }}-${{ github.sha }}"
dotnet pack src/Tmds.DBus --configuration Release --output src/Tmds.DBus /p:VersionSuffix="$VERSION_SUFFIX"
dotnet pack src/Tmds.DBus.Protocol --configuration Release --output src/Tmds.DBus.Protocol /p:VersionSuffix="$VERSION_SUFFIX"
dotnet pack src/Tmds.DBus.Tool --configuration Release --output src/Tmds.DBus.Tool /p:VersionSuffix="$VERSION_SUFFIX"
- name: Publish packages
run: |
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus/*.nupkg
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus.Protocol/*.nupkg
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus.Tool/*.nupkg
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

- name: Generate coverage report
run: ~/.dotnet/tools/reportgenerator -reports:test/Tmds.DBus.Protocol.Tests/TestResults/*/coverage.cobertura.xml -targetdir:coverage-reports

- name: Upload coverage reports to artifacts
uses: actions/upload-artifact@v2
with:
name: coverage-reports
path: coverage-reports

- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "7.0.x"

- name: Install reportgenerator tool
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Fetch sources
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run tests
run: |
pushd test/Tmds.DBus.Tests && dotnet test && popd
pushd test/Tmds.DBus.Protocol.Tests && dotnet test --collect:"XPlat Code Coverage" && popd
- name: Build tool
run: |
pushd src/Tmds.DBus.Tool && dotnet build && popd
- name: Build packages
run: |
VERSION_SUFFIX="${{ github.run_number }}-${{ github.sha }}"
dotnet pack src/Tmds.DBus --configuration Release --output src/Tmds.DBus /p:VersionSuffix="$VERSION_SUFFIX"
dotnet pack src/Tmds.DBus.Protocol --configuration Release --output src/Tmds.DBus.Protocol /p:VersionSuffix="$VERSION_SUFFIX"
dotnet pack src/Tmds.DBus.Tool --configuration Release --output src/Tmds.DBus.Tool /p:VersionSuffix="$VERSION_SUFFIX"
- name: Publish packages
run: |
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus/*.nupkg
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus.Protocol/*.nupkg
dotnet nuget push -s https://www.myget.org/F/tmds/api/v2/package -k "${{ secrets.NUGET_APIKEY }}" src/Tmds.DBus.Tool/*.nupkg
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

- name: Generate coverage report
run: ~/.dotnet/tools/reportgenerator -reports:test/Tmds.DBus.Protocol.Tests/TestResults/*/coverage.cobertura.xml -targetdir:coverage-reports

- name: Upload coverage reports to artifacts
uses: actions/upload-artifact@v2
with:
name: coverage-reports
path: coverage-reports
2 changes: 1 addition & 1 deletion src/Tmds.DBus.Tool/Tmds.DBus.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-dbus</ToolCommandName>
<AssemblyName>dotnet-dbus</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion test/Tmds.DBus.Tests/Tmds.DBus.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\sign.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
Expand Down

0 comments on commit bacf5e5

Please sign in to comment.