From 1be9b972ef608a3a06f87bace54171b7158fe70f Mon Sep 17 00:00:00 2001 From: ipax77 Date: Fri, 11 Sep 2026 09:29:16 +0200 Subject: [PATCH] add dotnet 10 support --- .github/workflows/ci-pages.yml | 21 +++++++++++++++++++ README.md | 4 ++-- .../Blazor.AI.BrowserModels.csproj | 9 ++++++-- .../Blazor.AI.BrowserModels.Tests.csproj | 7 +++++-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-pages.yml b/.github/workflows/ci-pages.yml index 1a121cd..11bd32b 100644 --- a/.github/workflows/ci-pages.yml +++ b/.github/workflows/ci-pages.yml @@ -22,6 +22,9 @@ jobs: pages: read steps: - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' - uses: actions/setup-dotnet@v4 with: global-json-file: global.json @@ -37,6 +40,24 @@ jobs: - run: dotnet test tests/Blazor.AI.BrowserModels.Tests -c Release --no-build --logger trx --results-directory artifacts/unit-results - name: Pack preview package run: dotnet pack src/Blazor.AI.BrowserModels -c Release --no-build -o artifacts/packages + - name: Verify package target frameworks + shell: bash + run: | + package=$(find artifacts/packages -maxdepth 1 -name '*.nupkg' ! -name '*.snupkg' -print -quit) + test -n "$package" + entries=$(unzip -Z1 "$package") + grep -Fxq 'lib/net10.0/Blazor.AI.BrowserModels.dll' <<< "$entries" + grep -Fxq 'lib/net10.0/Blazor.AI.BrowserModels.xml' <<< "$entries" + grep -Fxq 'lib/net11.0/Blazor.AI.BrowserModels.dll' <<< "$entries" + grep -Fxq 'lib/net11.0/Blazor.AI.BrowserModels.xml' <<< "$entries" + test "$(grep -Fxc 'staticwebassets/attachments.js' <<< "$entries")" -eq 1 + test "$(grep -Fxc 'staticwebassets/browserModel.js' <<< "$entries")" -eq 1 + nuspec=$(unzip -p "$package" Blazor.AI.BrowserModels.nuspec) + grep -Fq '' <<< "$nuspec" + grep -Fq '' <<< "$nuspec" + grep -Fq ' [!NOTE] -> This is a preview package targeting .NET 11. Browser support also depends on the installed model, hardware, storage, browser policy, and the page being served from localhost or HTTPS. See Chrome's [Prompt API documentation](https://developer.chrome.com/docs/ai/prompt-api) for current requirements. +> This is a preview package targeting .NET 10 and .NET 11. Browser support also depends on the installed model, hardware, storage, browser policy, and the page being served from localhost or HTTPS. See Chrome's [Prompt API documentation](https://developer.chrome.com/docs/ai/prompt-api) for current requirements. ## Install @@ -139,7 +139,7 @@ Open the displayed localhost URL in a compatible desktop Chrome installation and ## Build and test -The repository pins its preview .NET SDK in `global.json`. Node.js 22.12 or newer is needed only when changing the TypeScript sources. +The repository pins its preview .NET 11 SDK in `global.json`. Install both the .NET 10 and .NET 11 SDKs to build and run the complete unit-test matrix. Node.js 22.12 or newer is needed only when changing the TypeScript sources. ```powershell npm ci diff --git a/src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj b/src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj index bd29af9..1af70a7 100644 --- a/src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj +++ b/src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj @@ -1,6 +1,6 @@ - net11.0 + net10.0;net11.0 enable enable Blazor.AI.BrowserModels @@ -19,8 +19,13 @@ $(NoWarn);1591 true - + + + + + + diff --git a/tests/Blazor.AI.BrowserModels.Tests/Blazor.AI.BrowserModels.Tests.csproj b/tests/Blazor.AI.BrowserModels.Tests/Blazor.AI.BrowserModels.Tests.csproj index 45ffd98..e41fa4b 100644 --- a/tests/Blazor.AI.BrowserModels.Tests/Blazor.AI.BrowserModels.Tests.csproj +++ b/tests/Blazor.AI.BrowserModels.Tests/Blazor.AI.BrowserModels.Tests.csproj @@ -1,6 +1,6 @@ - net11.0 + net10.0;net11.0 enable enable true @@ -8,10 +8,13 @@ - + + + +