diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 54521c87..f12419a7 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -15,12 +15,13 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup dotNET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.0.x - 7.0.x + 6.x + 7.x 8.x + 9.x - name: Get Version run: echo "VERSION=$(date '+%Y.%m%d-beta%H%M')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8304b4e8..ff40952f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,12 +12,13 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup dotNET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.0.x - 7.0.x + 6.x + 7.x 8.x + 9.x - name: Build run: | dotnet build -c Release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5193f2af..fb7627bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,13 +14,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v3 + - name: Setup dotNET + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.0.x - 7.0.x + 6.x + 7.x 8.x + 9.x - name: Build run: | dotnet build -c Release diff --git a/ClientTest/ClientTest.csproj b/ClientTest/ClientTest.csproj index 609d3d30..f7263e56 100644 --- a/ClientTest/ClientTest.csproj +++ b/ClientTest/ClientTest.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 ..\Bin\ClientTest false diff --git a/DeployAgent/DeployAgent.csproj b/DeployAgent/DeployAgent.csproj index f4121a60..c8ce3a05 100644 --- a/DeployAgent/DeployAgent.csproj +++ b/DeployAgent/DeployAgent.csproj @@ -2,7 +2,7 @@ Exe - net461;net6.0;net7.0;net8.0 + net461;net6.0;net7.0;net8.0;net9.0 星尘发布 自动下载代码,编译后打包输出并推送发布中心。 新生命开发团队 diff --git a/StarAgent/StarAgent.csproj b/StarAgent/StarAgent.csproj index d3218555..21ef221f 100644 --- a/StarAgent/StarAgent.csproj +++ b/StarAgent/StarAgent.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;net5.0;net6.0;net45;net461;net7.0;net8.0 + netcoreapp3.1;net5.0;net6.0;net45;net461;net7.0;net8.0;net9.0 星尘代理 星尘,分布式资源调度,部署于每一个节点,连接服务端,支持节点监控、远程发布。 新生命开发团队 @@ -47,7 +47,7 @@ - + diff --git a/StarGateway/StarGateway.csproj b/StarGateway/StarGateway.csproj index 2c395072..2d6f0814 100644 --- a/StarGateway/StarGateway.csproj +++ b/StarGateway/StarGateway.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 星尘网关 星尘网关,转发网络请求,实现路由切换。 新生命开发团队 diff --git a/Stardust.Extensions/Stardust.Extensions.csproj b/Stardust.Extensions/Stardust.Extensions.csproj index 939af0e3..e81200f8 100644 --- a/Stardust.Extensions/Stardust.Extensions.csproj +++ b/Stardust.Extensions/Stardust.Extensions.csproj @@ -2,12 +2,12 @@ Library - netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 星尘分布式服务扩展 星尘,分布式服务框架扩展。节点管理,监控中心,配置中心,发布中心,注册中心 新生命开发团队 ©2002-2024 NewLife - 3.1 + 3.2 $([System.DateTime]::Now.ToString(`yyyy.MMdd`)) $(VersionPrefix).$(VersionSuffix) $(Version) diff --git a/Stardust.Server/Stardust.Server.csproj b/Stardust.Server/Stardust.Server.csproj index 872ac66e..1cab7232 100644 --- a/Stardust.Server/Stardust.Server.csproj +++ b/Stardust.Server/Stardust.Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 StarServer 星尘服务平台 星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心 @@ -46,7 +46,7 @@ - + diff --git a/Stardust.ServerTests/Stardust.ServerTests.csproj b/Stardust.ServerTests/Stardust.ServerTests.csproj index 52541351..2f2728db 100644 --- a/Stardust.ServerTests/Stardust.ServerTests.csproj +++ b/Stardust.ServerTests/Stardust.ServerTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 ..\Bin\ServerTest false @@ -20,7 +20,7 @@ - + diff --git a/Stardust.Web/Stardust.Web.csproj b/Stardust.Web/Stardust.Web.csproj index bfe53034..639cac4e 100644 --- a/Stardust.Web/Stardust.Web.csproj +++ b/Stardust.Web/Stardust.Web.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 StarWeb 星尘管理平台 星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心 @@ -53,7 +53,7 @@ - + diff --git a/Stardust/Managers/FrameworkManager.cs b/Stardust/Managers/FrameworkManager.cs index 005f7a04..6d9cf1df 100644 --- a/Stardust/Managers/FrameworkManager.cs +++ b/Stardust/Managers/FrameworkManager.cs @@ -136,6 +136,18 @@ public void Attach(ICommandClient client) nr.InstallNet8(ver, kind); } + else if (ver.StartsWithIgnoreCase("9.")) + { + var kind = ""; + var p = ver.IndexOf('-'); + if (p > 0) + { + kind = ver.Substring(p + 1); + ver = ver.Substring(0, p); + } + + nr.InstallNet9(ver, kind); + } else throw new Exception($"不支持的.NET版本[{ver}]"); diff --git a/Stardust/Managers/NetRuntime.cs b/Stardust/Managers/NetRuntime.cs index fbf4d8e3..9b9ed9d9 100644 --- a/Stardust/Managers/NetRuntime.cs +++ b/Stardust/Managers/NetRuntime.cs @@ -511,6 +511,91 @@ public Boolean InstallNet8(String target, String? kind = null) return false; } +#if NET20 + var is64 = IntPtr.Size == 8; +#else + var is64 = Environment.Is64BitOperatingSystem; +#endif + + // win7需要vc2019运行时 + var osVer = Environment.OSVersion.Version; + var isWin7 = osVer.Major == 6 && osVer.Minor == 1; + if (isWin7 && ver.Major < 6) + { + if (is64) + { + Install("Windows6.1-KB3063858-x64.msu", "/win7", "/quiet /norestart"); + Install("VC_redist.x64.exe", "/vc2019", "/passive"); + } + else + { + Install("Windows6.1-KB3063858-x86.msu", "/win7", "/quiet /norestart"); + Install("VC_redist.x86.exe", "/vc2019", "/passive"); + } + } + + var rs = false; + if (is64) + { + switch (kind) + { + case "aspnet": + rs = Install($"dotnet-runtime-{target}-win-x64.exe"); + rs = Install($"aspnetcore-runtime-{target}-win-x64.exe"); + break; + case "desktop": + rs = Install($"windowsdesktop-runtime-{target}-win-x64.exe"); + break; + case "host": + rs = Install($"dotnet-hosting-{target}-win.exe"); + break; + default: + rs = Install($"dotnet-runtime-{target}-win-x64.exe"); + break; + } + } + else + { + switch (kind) + { + case "aspnet": + rs = Install($"dotnet-runtime-{target}-win-x86.exe"); + rs = Install($"aspnetcore-runtime-{target}-win-x86.exe"); + break; + case "desktop": + rs = Install($"windowsdesktop-runtime-{target}-win-x86.exe"); + break; + case "host": + rs = Install($"dotnet-hosting-{target}-win.exe"); + break; + default: + rs = Install($"dotnet-runtime-{target}-win-x86.exe"); + break; + } + } + + return rs; + } + + /// 安装.NET9.0 + /// 目标版本。包括子版本,如6.0.15 + /// 安装类型。如aspnet/desktop/host + public Boolean InstallNet9(String target, String? kind = null) + { + var vers = GetNetCore(); + + var suffix = ""; + if (!String.IsNullOrEmpty(kind)) suffix = "-" + kind; + var ver = GetLast(vers, "v9.0", suffix); + + // 目标版本 + var targetVer = new Version(target); + if (!Force && ver >= targetVer) + { + WriteLog("已安装最新版 v{0}", ver); + return false; + } + #if NET20 var is64 = IntPtr.Size == 8; #else diff --git a/Stardust/Stardust.csproj b/Stardust/Stardust.csproj index 82a79aeb..dd96b044 100644 --- a/Stardust/Stardust.csproj +++ b/Stardust/Stardust.csproj @@ -1,13 +1,13 @@  - net45;net461;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net6.0-windows;net7.0;net7.0-windows;net8.0;net8.0-windows + net45;net461;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net6.0-windows;net7.0;net7.0-windows;net8.0;net8.0-windows;net9.0;net9.0-windows Stardust 星尘分布式服务核心 星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心 新生命开发团队 ©2002-2024 NewLife - 3.1 + 3.2 $([System.DateTime]::Now.ToString(`yyyy.MMdd`)) $(VersionPrefix).$(VersionSuffix) $(Version) @@ -39,7 +39,7 @@ Readme.MD - + true @@ -70,6 +70,9 @@ + + + @@ -114,7 +117,7 @@ - + diff --git a/Test/Test.csproj b/Test/Test.csproj index af01a459..d9f8d38a 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 1.0.* false ..\Bin\Test