chore: update .NET 9 target usage (#4262)

* refactor: update target framework net9 to net9.0

* ci: simplify dotnet 9 sdk setup
This commit is contained in:
Weihan Li 2024-10-13 00:29:29 +08:00 коммит произвёл GitHub
Родитель afeeb57631
Коммит 7d1a0d3c18
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
8 изменённых файлов: 15 добавлений и 84 удалений

7
.github/workflows/AntDesignDocsWebApp.yml поставляемый
Просмотреть файл

@ -25,12 +25,7 @@ jobs:
6.0.x
7.0.x
8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
9.0.x
- uses: actions/setup-node@v1
with:

9
.github/workflows/nightly-build.yml поставляемый
Просмотреть файл

@ -29,12 +29,7 @@ jobs:
6.0.x
7.0.x
8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
9.0.x
- uses: actions/setup-node@v1
with:
@ -118,7 +113,7 @@ jobs:
run: |
npm install
sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net9 -o cargo
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -o cargo
env:
PACKAGE_VERSION: ${{ steps.pack.outputs.package_version }}

11
.github/workflows/preview-build.yml поставляемый
Просмотреть файл

@ -23,18 +23,13 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
- name: Prepare AOT workload
run: |
dotnet workload install wasm-tools
@ -45,8 +40,8 @@ jobs:
npm install
dotnet build
sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net9 -o _site -p:EnableAOT=true
cp -rf ./site/AntDesign.Docs.Wasm/bin/Debug/net9/*.dll _site/wwwroot/_framework
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -o _site -p:EnableAOT=true
cp -rf ./site/AntDesign.Docs.Wasm/bin/Debug/net9.0/*.dll _site/wwwroot/_framework
find ./_site/wwwroot -type f -name '*.html' -exec bash -c 'if [ $(grep -o "<title>" "$1" | wc -l) -gt 1 ]; then perl -0777 -i -pe "s/<title>.*?<\/title>//s" "$1"; fi' _ {} \;
env:
PACKAGE_VERSION: ${{ github.event.number }}

7
.github/workflows/pull-request.yml поставляемый
Просмотреть файл

@ -22,12 +22,7 @@ jobs:
6.0.x
7.0.x
8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
9.0.x
- uses: actions/setup-node@v1
with:

11
.github/workflows/release-AOT.yml поставляемый
Просмотреть файл

@ -27,12 +27,7 @@ jobs:
6.0.x
7.0.x
8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
9.0.x
- uses: actions/setup-node@v1
with:
@ -56,9 +51,9 @@ jobs:
sed -i s/{version}/$VERSION/g ./site/AntDesign.Docs.Wasm/wwwroot/index.html
sed -i s/{version}/$VERSION/g ./site/AntDesign.Docs.Wasm/wwwroot/service-worker.published.js
dotnet build
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net9 -o cargo -p:EnableAOT=true
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -o cargo -p:EnableAOT=true
cp -rf cargo/staticwebapp.config.json cargo/wwwroot
cp -rf ./site/AntDesign.Docs.Wasm/bin/Debug/net9/*.dll cargo/wwwroot/_framework
cp -rf ./site/AntDesign.Docs.Wasm/bin/Debug/net9.0/*.dll cargo/wwwroot/_framework
find ./cargo/wwwroot -type f -name '*.html' -exec bash -c 'if [ $(grep -o "<title>" "$1" | wc -l) -gt 1 ]; then perl -0777 -i -pe "s/<title>.*?<\/title>//s" "$1"; fi' _ {} \;
- name: Deploy to Azure 🚀

7
.github/workflows/release.yml поставляемый
Просмотреть файл

@ -25,12 +25,7 @@ jobs:
6.0.x
7.0.x
8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-quality: 'preview'
dotnet-version: '9.0.x'
9.0.x
- uses: actions/setup-node@v1
with:

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net9</TargetFrameworks>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
@ -17,31 +17,7 @@
<DocFiles Include="$(SolutionDir)docs\**\*.*"></DocFiles>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5'">
<PackageReference Include="BlazorPolyfill.Server">
<Version>5.0.102</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6'">
<PackageReference Include="BlazorPolyfill.Server">
<Version>6.0.100.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7'">
<PackageReference Include="BlazorPolyfill.Server">
<Version>6.0.100.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8'">
<PackageReference Include="BlazorPolyfill.Server">
<Version>6.0.100.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9'">
<ItemGroup>
<PackageReference Include="BlazorPolyfill.Server">
<Version>6.0.100.1</Version>
</PackageReference>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFrameworks>net9</TargetFrameworks>
<TargetFramework>net9.0</TargetFramework>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<BlazorWebAssemblyLoadAllGlobalizationData>false</BlazorWebAssemblyLoadAllGlobalizationData>
</PropertyGroup>
@ -11,22 +11,7 @@
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework) == 'net6'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net7'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net8'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net9'">
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0-rc.2.*" PrivateAssets="all" />
</ItemGroup>