From 450ccf94421c664b5cbb50223ddaea125067aa92 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Sat, 15 Nov 2025 12:10:06 +0500 Subject: [PATCH] upgrade to net10.0 --- .github/workflows/codeql-analysis.yml | 4 +--- .github/workflows/dotnet.yml | 12 +++--------- Clients/CirrusCiClient/CirrusCiClient.csproj | 2 +- Clients/CompatApiClient/CompatApiClient.csproj | 2 +- Clients/GithubClient/Client.CI.cs | 2 +- Clients/GithubClient/GithubClient.csproj | 5 ++--- Clients/IrdLibraryClient/IrdLibraryClient.csproj | 2 +- Clients/MediafireClient/MediafireClient.csproj | 2 +- Clients/OneDriveClient/OneDriveClient.csproj | 2 +- Clients/PsnClient/PsnClient.csproj | 2 +- Clients/YandexDiskClient/YandexDiskClient.csproj | 2 +- CompatBot/Commands/Sudo.Mod.cs | 5 +++-- CompatBot/CompatBot.csproj | 9 ++++----- CompatBot/Database/Providers/DiscLanguageProvider.cs | 1 + CompatBot/EventHandlers/LogParsingHandler.cs | 4 ++-- CompatBot/ThumbScrapper/PsnScraper.cs | 2 +- .../Utils/Extensions/AzureDevOpsClientExtensions.cs | 2 +- Dockerfile | 8 ++++---- HomoglyphConverter/HomoglyphConverter.csproj | 2 +- README.md | 4 ++-- SourceGenerators/SourceGenerators.csproj | 2 +- Tests/Tests.csproj | 2 +- 22 files changed, 35 insertions(+), 43 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0146626f..c9182dde 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -54,9 +54,7 @@ jobs: - name: Update dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: 10.0.x - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a3747cb5..ff2de713 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,9 +15,7 @@ jobs: - name: update dotnet core sdk uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: 10.0.x - name: dotnet restore (first try) run: dotnet restore --ignore-failed-sources - name: dotnet restore (second try) @@ -37,9 +35,7 @@ jobs: - name: update dotnet core sdk uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: 10.0.x - name: dotnet restore (first try) run: dotnet restore --ignore-failed-sources - name: dotnet restore (second try) @@ -74,9 +70,7 @@ jobs: - name: update dotnet core sdk uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: 10.0.x - name: dotnet restore (first try) run: dotnet restore --ignore-failed-sources - name: dotnet restore (second try) diff --git a/Clients/CirrusCiClient/CirrusCiClient.csproj b/Clients/CirrusCiClient/CirrusCiClient.csproj index bc165ed9..d0da0f46 100644 --- a/Clients/CirrusCiClient/CirrusCiClient.csproj +++ b/Clients/CirrusCiClient/CirrusCiClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 enable false latest diff --git a/Clients/CompatApiClient/CompatApiClient.csproj b/Clients/CompatApiClient/CompatApiClient.csproj index fcc7cc93..6ac63cc0 100644 --- a/Clients/CompatApiClient/CompatApiClient.csproj +++ b/Clients/CompatApiClient/CompatApiClient.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable latest diff --git a/Clients/GithubClient/Client.CI.cs b/Clients/GithubClient/Client.CI.cs index b99012eb..36c776eb 100644 --- a/Clients/GithubClient/Client.CI.cs +++ b/Clients/GithubClient/Client.CI.cs @@ -328,7 +328,7 @@ public partial class Client .ToList(); return await builds .ToAsyncEnumerable() - .SelectAwait(async b => await GetArtifactsInfoAsync(b.HeadSha, b, cancellationToken).ConfigureAwait(false)) + .Select((b, ct) => GetArtifactsInfoAsync(b.HeadSha, b, ct)) .ToListAsync(cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/Clients/GithubClient/GithubClient.csproj b/Clients/GithubClient/GithubClient.csproj index ebceb712..4f6673b6 100644 --- a/Clients/GithubClient/GithubClient.csproj +++ b/Clients/GithubClient/GithubClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 latest enable @@ -8,9 +8,8 @@ - - \ No newline at end of file + diff --git a/Clients/IrdLibraryClient/IrdLibraryClient.csproj b/Clients/IrdLibraryClient/IrdLibraryClient.csproj index 6a9105fe..59c695c5 100644 --- a/Clients/IrdLibraryClient/IrdLibraryClient.csproj +++ b/Clients/IrdLibraryClient/IrdLibraryClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 latest enable diff --git a/Clients/MediafireClient/MediafireClient.csproj b/Clients/MediafireClient/MediafireClient.csproj index 0f649137..9716b12a 100644 --- a/Clients/MediafireClient/MediafireClient.csproj +++ b/Clients/MediafireClient/MediafireClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 enable latest diff --git a/Clients/OneDriveClient/OneDriveClient.csproj b/Clients/OneDriveClient/OneDriveClient.csproj index 0f649137..9716b12a 100644 --- a/Clients/OneDriveClient/OneDriveClient.csproj +++ b/Clients/OneDriveClient/OneDriveClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 enable latest diff --git a/Clients/PsnClient/PsnClient.csproj b/Clients/PsnClient/PsnClient.csproj index 2500912f..ac3b279d 100644 --- a/Clients/PsnClient/PsnClient.csproj +++ b/Clients/PsnClient/PsnClient.csproj @@ -1,6 +1,6 @@  - net9.0 + net10.0 enable latest diff --git a/Clients/YandexDiskClient/YandexDiskClient.csproj b/Clients/YandexDiskClient/YandexDiskClient.csproj index 0f649137..9716b12a 100644 --- a/Clients/YandexDiskClient/YandexDiskClient.csproj +++ b/Clients/YandexDiskClient/YandexDiskClient.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 enable latest diff --git a/CompatBot/Commands/Sudo.Mod.cs b/CompatBot/Commands/Sudo.Mod.cs index 2c547e2c..67e036de 100644 --- a/CompatBot/Commands/Sudo.Mod.cs +++ b/CompatBot/Commands/Sudo.Mod.cs @@ -1,4 +1,5 @@ -using CompatBot.Database.Providers; +using CompatBot.Database; +using CompatBot.Database.Providers; namespace CompatBot.Commands; @@ -80,7 +81,7 @@ internal static partial class Sudo var modList = ModProvider.Mods .Values .ToAsyncEnumerable() - .SelectAwait(async m =>(m: m, u: await ctx.Client.GetUserAsync(m.DiscordId).ConfigureAwait(false))) + .Select(async (Moderator m, CancellationToken _) => (m: m, u: await ctx.Client.GetUserAsync(m.DiscordId).ConfigureAwait(false))) .OrderByDescending(i => i.m.Sudoer) .ThenBy(i => i.u.Username) .ToList(); diff --git a/CompatBot/CompatBot.csproj b/CompatBot/CompatBot.csproj index 3e2e0510..212b4301 100644 --- a/CompatBot/CompatBot.csproj +++ b/CompatBot/CompatBot.csproj @@ -1,7 +1,7 @@  Exe - net9.0 + net10.0 true CompatBot c2e6548b-b215-4a18-a010-958ef294b310 @@ -55,12 +55,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -75,7 +75,6 @@ - diff --git a/CompatBot/Database/Providers/DiscLanguageProvider.cs b/CompatBot/Database/Providers/DiscLanguageProvider.cs index 5b50360a..b5e20e96 100644 --- a/CompatBot/Database/Providers/DiscLanguageProvider.cs +++ b/CompatBot/Database/Providers/DiscLanguageProvider.cs @@ -146,6 +146,7 @@ public static partial class DiscLanguageProvider ["Italy"] = "🇮🇹", ["Japan"] = "🇯🇵", ["Korea"] = "🇰🇷", + ["Latin America"] = "🇱🇽", // not a real code ["Mexico"] = "🇲🇽", ["New Zealand"] = "🇳🇿", ["Poland"] = "🇵🇱", diff --git a/CompatBot/EventHandlers/LogParsingHandler.cs b/CompatBot/EventHandlers/LogParsingHandler.cs index 38829c54..fa135c6e 100644 --- a/CompatBot/EventHandlers/LogParsingHandler.cs +++ b/CompatBot/EventHandlers/LogParsingHandler.cs @@ -84,7 +84,7 @@ public static class LogParsingHandler DiscordMessage? botMsg = null; var possibleHandlers = SourceHandlers .ToAsyncEnumerable() - .SelectAwait(async h => await h.FindHandlerAsync(message, ArchiveHandlers).ConfigureAwait(false)) + .Select(async (ISourceHandler h, CancellationToken _) => await h.FindHandlerAsync(message, ArchiveHandlers).ConfigureAwait(false)) .ToList(); using var source = possibleHandlers.FirstOrDefault(h => h.IsSuccess())?.Data; var fail = possibleHandlers.FirstOrDefault(h => h is {Message.Length: >0})?.Message; @@ -446,4 +446,4 @@ public static class LogParsingHandler Color = Config.Colors.LogUnknown, }; } -} \ No newline at end of file +} diff --git a/CompatBot/ThumbScrapper/PsnScraper.cs b/CompatBot/ThumbScrapper/PsnScraper.cs index 94d129b8..2ac04898 100644 --- a/CompatBot/ThumbScrapper/PsnScraper.cs +++ b/CompatBot/ThumbScrapper/PsnScraper.cs @@ -328,7 +328,7 @@ internal sealed partial class PsnScraper .Select(sku => sku.Id) .Distinct() .ToAsyncEnumerable() - .WhereAwait(async id => ProductCodeLookup.Pattern().IsMatch(id) + .Where(async (id, _) => ProductCodeLookup.Pattern().IsMatch(id) && await NeedLookupAsync(id).ConfigureAwait(false) ).ToList(); foreach (var relatedSku in relatedSkus) diff --git a/CompatBot/Utils/Extensions/AzureDevOpsClientExtensions.cs b/CompatBot/Utils/Extensions/AzureDevOpsClientExtensions.cs index 014eff8f..30f1ee9f 100644 --- a/CompatBot/Utils/Extensions/AzureDevOpsClientExtensions.cs +++ b/CompatBot/Utils/Extensions/AzureDevOpsClientExtensions.cs @@ -124,7 +124,7 @@ internal static class AzureDevOpsClientExtensions .ToList(); return await builds .ToAsyncEnumerable() - .SelectAwait(async b => await azureDevOpsClient.GetArtifactsInfoAsync(b.SourceVersion, b, cancellationToken).ConfigureAwait(false)) + .Select((b, ct) => azureDevOpsClient.GetArtifactsInfoAsync(b.SourceVersion, b, ct)) .ToListAsync(cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/Dockerfile b/Dockerfile index c0d9a9d3..de20ee1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS base +FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS base # Native libgdiplus dependencies RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --allow-unauthenticated libc6-dev libgdiplus libx11-dev fonts-roboto tzdata libarchive13t64 liblept5 -RUN wget https://archive.ubuntu.com/ubuntu/pool/main/t/tiff/libtiff5_4.3.0-6_amd64.deb -RUN dpkg -i ./libtiff5_4.3.0-6_amd64.deb -RUN rm ./libtiff5_4.3.0-6_amd64.deb +RUN wget https://archive.ubuntu.com/ubuntu/pool/main/t/tiff/libtiff5_4.3.0-6ubuntu0.12_amd64.deb +RUN dpkg -i ./libtiff5_4.3.0-6ubuntu0.12_amd64.deb +RUN rm ./libtiff5_4.3.0-6ubuntu0.12_amd64.deb # Regular stuff #COPY packages /root/.nuget/packages/ diff --git a/HomoglyphConverter/HomoglyphConverter.csproj b/HomoglyphConverter/HomoglyphConverter.csproj index cc6d2575..e1abc839 100644 --- a/HomoglyphConverter/HomoglyphConverter.csproj +++ b/HomoglyphConverter/HomoglyphConverter.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 latest enable false diff --git a/README.md b/README.md index ed3009d5..6281a15a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ You can read the design and implementation notes by visiting the folders in the Development Requirements ------------------------ -* [.NET 9.0 SDK](https://dotnet.microsoft.com/download) or newer +* [.NET 10.0 SDK](https://dotnet.microsoft.com/download) or newer * Any text editor, but here are some recommends: * [Visual Studio](https://visualstudio.microsoft.com/) (Windows, has free Community edition) * [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free) @@ -17,7 +17,7 @@ Development Requirements Runtime Requirements -------------------- -* [.NET 9.0 SDK](https://dotnet.microsoft.com/download) or newer to run from sources +* [.NET 10.0 SDK](https://dotnet.microsoft.com/download) or newer to run from sources * Bot needs `dotnet` command to be available (i.e. alias for the Snap package) * OCR on Linux requires the following dependencies to be installed: `libarchive.so.13`, `liblept.so.5`, `libtiff.so.5` * On Ubuntu 24.04 this is provided by the following packages: diff --git a/SourceGenerators/SourceGenerators.csproj b/SourceGenerators/SourceGenerators.csproj index c59253bf..c2fba4f7 100644 --- a/SourceGenerators/SourceGenerators.csproj +++ b/SourceGenerators/SourceGenerators.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 359bb547..711a68c5 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,6 +1,6 @@  - net9.0 + net10.0 false latest enable