Skip to content

Commit 2dd72b5

Browse files
authored
Update to .NET 10.0 and modernize project targets (#904)
* Update to .NET 10.0 and modernize project targets Bump all workflows and project files to use .NET 10.0, update Nager.Date to target net481 and net10.0. Also update NuGet push URL to the v3 endpoint for improved compatibility. * fix unit test warnings
1 parent 592ae82 commit 2dd72b5

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

.github/workflows/dotnet-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15-
- name: Setup .NET 9.0
15+
- name: Setup .NET 10.0
1616
uses: actions/setup-dotnet@v5
1717
with:
18-
dotnet-version: 9.0.x
18+
dotnet-version: 10.0.x
1919
- name: Extract Version from tag
2020
id: tag
2121
uses: actions/github-script@v8
@@ -52,4 +52,4 @@ jobs:
5252
- name: Push NuGet package
5353
run: |
5454
cd $GITHUB_WORKSPACE/out
55-
dotnet nuget push *.nupkg --source https://www.nuget.org/api/v2/package --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols
55+
dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v5
22-
- name: Setup .NET 9.0
22+
- name: Setup .NET 10.0
2323
uses: actions/setup-dotnet@v5
2424
with:
25-
dotnet-version: 9.0.x
25+
dotnet-version: 10.0.x
2626
- name: Restore dependencies
2727
working-directory: ./src
2828
run: dotnet restore

src/Nager.Date.ArchitectureTest/Nager.Date.ArchitectureTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77

src/Nager.Date.Console/Nager.Date.Console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

src/Nager.Date.UnitTest/Countries/BrazilTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void TestBrazil()
1212
{
1313
var testDate = new DateTime(2022, 10, 12);
1414
var isPublicHoliday = HolidaySystem.IsPublicHoliday(testDate, CountryCode.BR);
15-
Assert.AreEqual(true, isPublicHoliday);
15+
Assert.IsTrue(isPublicHoliday);
1616
}
1717

1818
[TestMethod]

src/Nager.Date.UnitTest/Countries/GermanyTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void TestGermanyLiberationDay(int startYear, int endYear, int expectedYea
6060
Assert.IsNotNull(liberationDay);
6161
Assert.AreEqual(new DateTime(expectedYear, 5, 8), liberationDay.Date);
6262
Assert.IsNotNull(liberationDay.SubdivisionCodes);
63-
Assert.AreEqual(1, liberationDay.SubdivisionCodes.Length);
63+
Assert.HasCount(1, liberationDay.SubdivisionCodes);
6464
Assert.AreEqual("DE-BE", liberationDay.SubdivisionCodes[0]);
6565
}
6666

src/Nager.Date.UnitTest/Countries/SingaporeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void HolidayCount()
2020
for (var year = 2018; year <= 2022; year++)
2121
{
2222
var publicHolidays = HolidaySystem.GetHolidays(year, CountryCode.SG).ToArray();
23-
Assert.AreEqual(11, publicHolidays.Length);
23+
Assert.HasCount(11, publicHolidays);
2424
}
2525
}
2626
}

src/Nager.Date.UnitTest/Nager.Date.UnitTest.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77

@@ -10,7 +10,7 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
13-
<PackageReference Include="MSTest.TestAdapter" Version="3.11.0" />
13+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
1414
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
1515
</ItemGroup>
1616

src/Nager.Date/Nager.Date.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<RepositoryUrl>https://github.com/nager/Nager.Date</RepositoryUrl>
2424

25-
<TargetFrameworks>net472;netstandard2.0;net6.0;net8.0</TargetFrameworks>
25+
<TargetFrameworks>net481;netstandard2.0;net8.0;net10.0</TargetFrameworks>
2626

2727
<!-- Version is automatically replaced by build process -->
2828
<Version>2.0.0</Version>

0 commit comments

Comments
 (0)