Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from net6 to net9 and update SDKs #1076

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
38 changes: 25 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,77 @@ jobs:
os: macos-13
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
# current macOS, latest LTS and latest
- job:
os: macos-14
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
- job:
os: macos-14
tests:
framework: net9.0
sdk: "9.0.102"
sdk-major-minor: "9.0"
# old Linux, latest LTS
- job:
os: ubuntu-20.04
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
# old Linux, latest LTS
- job:
os: ubuntu-22.04
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
# current Linux, all
- job:
os: ubuntu-24.04
tests:
framework: net6.0
sdk: "6.0.425"
sdk-major-minor: "6.0"
framework: net8.0
sdk: "8.0.405"
sdk-major-minor: "8.0"
- job:
os: ubuntu-24.04
upload: true
tests:
framework: net8.0
sdk: "8.0.401"
sdk-major-minor: "8.0"
framework: net9.0
sdk: "9.0.102"
sdk-major-minor: "9.0"
# old Windows, latest LTS
- job:
os: windows-2019
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
# current Windows, latest LTS and latest
- job:
os: windows-2022
tests:
framework: net8.0
sdk: "8.0.401"
sdk: "8.0.405"
sdk-major-minor: "8.0"
- job:
os: windows-2022
tests:
framework: net9.0
sdk: "9.0.102"
sdk-major-minor: "9.0"
name: ${{ matrix.job.os }}-sdk-${{ matrix.tests.sdk-major-minor }}
runs-on: ${{ matrix.job.os }}
steps:
- uses: actions/[email protected]
with:
dotnet-version: |
${{ matrix.tests.sdk }}
8.0.401
9.0.102
- run: dotnet --info
- run: git --version
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/infer-sharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
dotnet-version: '8.0.401'
dotnet-version: '9.0.102'
- uses: actions/[email protected]
- run: dotnet build
- run: ls -al
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0.401
dotnet-version: 9.0.102
- uses: actions/[email protected]
- env:
MINVER_VERSION: ${{ vars.MINVER_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion MSBuild.Caching/MSBuild.Caching.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion MinVer.Lib/MinVer.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions MinVer/MinVer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RollForward>major</RollForward>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -43,7 +43,7 @@
<Content Include="build\**\*" PackagePath="build" />
<Content Include="buildMultiTargeting\**\*" PackagePath="buildMultiTargeting" />
<None Include="..\MSBuild.Caching\bin\$(Configuration)\net472\MSBuild.Caching.dll" Pack="true" PackagePath="build\bin\net472" Visible="false" />
<None Include="..\MSBuild.Caching\bin\$(Configuration)\net6.0\MSBuild.Caching.dll" Pack="true" PackagePath="build\bin\net6.0" Visible="false" />
<None Include="..\MSBuild.Caching\bin\$(Configuration)\net8.0\MSBuild.Caching.dll" Pack="true" PackagePath="build\bin\net8.0" Visible="false" />
</ItemGroup>

<Target Name="AddMinVerOutput" BeforeTargets="_GetPackageFiles">
Expand Down
7 changes: 4 additions & 3 deletions MinVer/build/MinVer.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MSBuildAllProjects Condition="'$(MSBuildAssemblyVersion)' == '' Or '$(MSBuildAssemblyVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);MinVer</GenerateNuspecDependsOn>
<GetPackageVersionDependsOn>$(GetPackageVersionDependsOn);MinVer</GetPackageVersionDependsOn>
<MinVerMSBuildCachingPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)bin\net6.0\MSBuild.Caching.dll</MinVerMSBuildCachingPath>
<MinVerMSBuildCachingPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)bin\net8.0\MSBuild.Caching.dll</MinVerMSBuildCachingPath>
<MinVerMSBuildCachingPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)bin\net472\MSBuild.Caching.dll</MinVerMSBuildCachingPath>
</PropertyGroup>

Expand All @@ -14,8 +14,9 @@
<PropertyGroup>
<MinVerDetailed>low</MinVerDetailed>
<MinVerDetailed Condition="'$(MinVerVerbosity)' == 'detailed' Or '$(MinVerVerbosity)' == 'd' Or '$(MinVerVerbosity)' == 'diagnostic' Or '$(MinVerVerbosity)' == 'diag'">high</MinVerDetailed>
<MinVerTargetFramework>net6.0</MinVerTargetFramework>
<MinVerTargetFramework Condition="'$(MSBuildAssemblyVersion)' &gt;= '17.8'">net8.0</MinVerTargetFramework>
<MinVerTargetFramework>net8.0</MinVerTargetFramework>
<!-- https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs#supported-net-versions -->
<MinVerTargetFramework Condition="'$(MSBuildAssemblyVersion)' &gt;= '17.12'">net9.0</MinVerTargetFramework>
<NoWarn>$(NoWarn);NU5105</NoWarn>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions MinVerTests.Infra/MinVerCli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public static class MinVerCli
}

public static string GetPath(string configuration) =>
#if NET6_0
Solution.GetFullPath($"minver-cli/bin/{configuration}/net6.0/minver-cli.dll");
#endif
#if NET8_0
Solution.GetFullPath($"minver-cli/bin/{configuration}/net8.0/minver-cli.dll");
#endif
#if NET9_0
Solution.GetFullPath($"minver-cli/bin/{configuration}/net9.0/minver-cli.dll");
#endif
}
2 changes: 1 addition & 1 deletion MinVerTests.Infra/MinVerTests.Infra.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions MinVerTests.Infra/Sdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ private static (Version Version, string InformationalVersion) GetAssemblyVersion

try
{
return (
assembly.GetName().Version ?? throw new InvalidOperationException("The assembly version is null."),
var version = assembly.GetName().Version ?? throw new InvalidOperationException("The assembly version is null.");
var informationalVersion =
assembly.GetCustomAttributes().OfType<AssemblyInformationalVersionAttribute>().FirstOrDefault()?.InformationalVersion ??
throw new InvalidOperationException("The assembly has no informational version."));
throw new InvalidOperationException("The assembly has no informational version.");

return (version, informationalVersion);
}
finally
{
Expand Down
4 changes: 3 additions & 1 deletion MinVerTests.Lib/MinVerTests.Lib.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- https://github.com/dotnet/roslyn-analyzers/issues/7192 -->
<NoWarn>$(NoWarn);CA1515</NoWarn>
<RollForward>major</RollForward>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion MinVerTests.Packages/MinVerTests.Packages.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- https://github.com/dotnet/roslyn-analyzers/issues/7192 -->
<NoWarn>$(NoWarn);CA1515</NoWarn>
<RollForward>major</RollForward>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<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": "9.0.100",
"rollForward": "latestMajor"
}
}
2 changes: 1 addition & 1 deletion minver-cli/minver-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RollForward>major</RollForward>
<RootNamespace>MinVer</RootNamespace>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ToolCommandName>minver</ToolCommandName>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion targets/Targets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RollForward>major</RollForward>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading