From 0471ad29913241e3d7e8a936516443ccb57ac6fd Mon Sep 17 00:00:00 2001 From: Thomas Clegg Date: Wed, 13 Nov 2024 10:21:00 -0600 Subject: [PATCH 1/3] .net 9 migration --- .github/workflows/build_and_run_unit_tests_linux.yml | 6 +++--- .../workflows/create_new_release_on_new_metadata_update.yml | 2 +- .../workflows/run_all_tests_and_upload_code_coverage.yml | 2 +- .github/workflows/run_performance_tests_windows.yml | 4 ++-- .../PhoneNumbers.Extensions.Test.csproj | 4 ++-- .../PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj | 2 +- .../PhoneNumbers.PerformanceTest.csproj | 4 ++-- csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj | 4 ++-- csharp/PhoneNumbers/PhoneNumbers.csproj | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_and_run_unit_tests_linux.yml b/.github/workflows/build_and_run_unit_tests_linux.yml index 887aba5d..59ae3324 100644 --- a/.github/workflows/build_and_run_unit_tests_linux.yml +++ b/.github/workflows/build_and_run_unit_tests_linux.yml @@ -14,7 +14,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Add zip files required for running tests run: | (cd resources/geocoding; zip -r ../../resources/geocoding.zip *) @@ -25,6 +25,6 @@ jobs: - name: Build solution run: dotnet build --no-restore working-directory: ./csharp - - name: Test solution targeting dotnet8.0 only - run: dotnet test --no-build --verbosity normal -p:TargetFrameworks=net8.0 + - name: Test solution targeting dotnet9.0 only + run: dotnet test --no-build --verbosity normal -p:TargetFrameworks=net9.0 working-directory: ./csharp diff --git a/.github/workflows/create_new_release_on_new_metadata_update.yml b/.github/workflows/create_new_release_on_new_metadata_update.yml index 74a30276..0c306285 100644 --- a/.github/workflows/create_new_release_on_new_metadata_update.yml +++ b/.github/workflows/create_new_release_on_new_metadata_update.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.x + dotnet-version: 9.x - name: Get new metadata information and create new GitHub release timeout-minutes: 30 run: | diff --git a/.github/workflows/run_all_tests_and_upload_code_coverage.yml b/.github/workflows/run_all_tests_and_upload_code_coverage.yml index 99c20ea4..a4f6202c 100644 --- a/.github/workflows/run_all_tests_and_upload_code_coverage.yml +++ b/.github/workflows/run_all_tests_and_upload_code_coverage.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Add zip files required for running tests run: | Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip" diff --git a/.github/workflows/run_performance_tests_windows.yml b/.github/workflows/run_performance_tests_windows.yml index c0a9ac9d..6f42cfa8 100644 --- a/.github/workflows/run_performance_tests_windows.yml +++ b/.github/workflows/run_performance_tests_windows.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Run performance tests - run: dotnet run -c Release --framework net8.0 + run: dotnet run -c Release --framework net9.0 working-directory: ./csharp/PhoneNumbers.PerformanceTest diff --git a/csharp/PhoneNumbers.Extensions.Test/PhoneNumbers.Extensions.Test.csproj b/csharp/PhoneNumbers.Extensions.Test/PhoneNumbers.Extensions.Test.csproj index 25e03248..a8e362d7 100644 --- a/csharp/PhoneNumbers.Extensions.Test/PhoneNumbers.Extensions.Test.csproj +++ b/csharp/PhoneNumbers.Extensions.Test/PhoneNumbers.Extensions.Test.csproj @@ -1,7 +1,7 @@ - netframework4.8;net6.0;net8.0 + netframework4.8;net8.0;net9.0 $(NoWarn);1591;CA1014;CA1062;CA1707 true true @@ -10,7 +10,7 @@ false - + enable diff --git a/csharp/PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj b/csharp/PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj index 2584711b..b971cce1 100644 --- a/csharp/PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj +++ b/csharp/PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj @@ -7,7 +7,7 @@ libphonenumber-csharp.extensions $(APPVEYOR_BUILD_VERSION) Thomas Clegg - netstandard2.0;net6.0;net8.0 + netstandard2.0;net8.0;net9.0 preview phonenumber phone libphonenumber e164 e.164 international extensions https://github.com/twcclegg/libphonenumber-csharp diff --git a/csharp/PhoneNumbers.PerformanceTest/PhoneNumbers.PerformanceTest.csproj b/csharp/PhoneNumbers.PerformanceTest/PhoneNumbers.PerformanceTest.csproj index 89ee2c56..1b95ff42 100644 --- a/csharp/PhoneNumbers.PerformanceTest/PhoneNumbers.PerformanceTest.csproj +++ b/csharp/PhoneNumbers.PerformanceTest/PhoneNumbers.PerformanceTest.csproj @@ -2,11 +2,11 @@ Exe - netframework4.8;net6.0;net8.0 + netframework4.8;net8.0;net9.0 disable - + enable diff --git a/csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj b/csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj index e3cfa1a7..484edc83 100644 --- a/csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj +++ b/csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj @@ -1,7 +1,7 @@ - netframework4.8;net6.0;net8.0 + netframework4.8;net8.0;net9.0 PhoneNumbers.Test PhoneNumbers.Test full @@ -9,7 +9,7 @@ true - + enable diff --git a/csharp/PhoneNumbers/PhoneNumbers.csproj b/csharp/PhoneNumbers/PhoneNumbers.csproj index 9c138dec..b1eb2be0 100644 --- a/csharp/PhoneNumbers/PhoneNumbers.csproj +++ b/csharp/PhoneNumbers/PhoneNumbers.csproj @@ -7,7 +7,7 @@ libphonenumber-csharp $(APPVEYOR_BUILD_VERSION) Patrick Mézard;Thomas Clegg;Jarrod Alexander;Google;libphonenumber contributors - netstandard2.0;net6.0;net8.0 + netstandard2.0;net8.0;net9.0 preview phonenumber phone libphonenumber e164 e.164 international https://github.com/twcclegg/libphonenumber-csharp @@ -25,7 +25,7 @@ true - + enable From fe84ffc27032db9b629d6c19c5254f528c518048 Mon Sep 17 00:00:00 2001 From: Thomas Clegg Date: Wed, 13 Nov 2024 10:35:12 -0600 Subject: [PATCH 2/3] Manually install .net9 --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 1a66ddd5..3bc8541c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,6 +22,10 @@ pull_requests: branches: only: - main +install: +- ps: | + Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1" + & $env:temp\dotnet-install.ps1 -Architecture x64 -Version '9.0.100' -InstallDir "$env:ProgramFiles\dotnet" before_build: - dotnet restore csharp -s https://api.nuget.org/v3/index.json - ps: Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip" From ac357682a08769f1137a9093b92817122d53346b Mon Sep 17 00:00:00 2001 From: Thomas Clegg Date: Thu, 14 Nov 2024 09:22:10 -0600 Subject: [PATCH 3/3] Update action to .net9 --- lib/github-actions-metadata-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github-actions-metadata-update.sh b/lib/github-actions-metadata-update.sh index 4dc462ee..43643780 100644 --- a/lib/github-actions-metadata-update.sh +++ b/lib/github-actions-metadata-update.sh @@ -113,7 +113,7 @@ cd ${GITHUB_ACTION_WORKING_DIRECTORY} cd csharp dotnet restore dotnet build --no-restore -dotnet test --no-build --verbosity normal -p:TargetFrameworks=net8.0 +dotnet test --no-build --verbosity normal -p:TargetFrameworks=net9.0 # Cleanup test dependencies rm -rf ${GITHUB_ACTION_WORKING_DIRECTORY}/resources/geocoding.zip rm -rf ${GITHUB_ACTION_WORKING_DIRECTORY}/resources/test/testgeocoding.zip