Skip to content

Commit

Permalink
v3.2.2024.1113 升级net9
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Nov 13, 2024
1 parent 4e4a627 commit c7da851
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 28 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ClientTest/ClientTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputPath>..\Bin\ClientTest</OutputPath>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion DeployAgent/DeployAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net461;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<AssemblyTitle>星尘发布</AssemblyTitle>
<Description>自动下载代码,编译后打包输出并推送发布中心。</Description>
<Company>新生命开发团队</Company>
Expand Down
4 changes: 2 additions & 2 deletions StarAgent/StarAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net45;net461;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net45;net461;net7.0;net8.0;net9.0</TargetFrameworks>
<AssemblyTitle>星尘代理</AssemblyTitle>
<Description>星尘,分布式资源调度,部署于每一个节点,连接服务端,支持节点监控、远程发布。</Description>
<Company>新生命开发团队</Company>
Expand Down Expand Up @@ -47,7 +47,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Agent" Version="10.9.2024.1009-beta0729" />
<PackageReference Include="NewLife.Agent" Version="10.10.2024.1113" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion StarGateway/StarGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyTitle>星尘网关</AssemblyTitle>
<Description>星尘网关,转发网络请求,实现路由切换。</Description>
<Company>新生命开发团队</Company>
Expand Down
4 changes: 2 additions & 2 deletions Stardust.Extensions/Stardust.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<AssemblyTitle>星尘分布式服务扩展</AssemblyTitle>
<Description>星尘,分布式服务框架扩展。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2024 NewLife</Copyright>
<VersionPrefix>3.1</VersionPrefix>
<VersionPrefix>3.2</VersionPrefix>
<VersionSuffix>$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</VersionSuffix>
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
<FileVersion>$(Version)</FileVersion>
Expand Down
4 changes: 2 additions & 2 deletions Stardust.Server/Stardust.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>StarServer</AssemblyName>
<AssemblyTitle>星尘服务平台</AssemblyTitle>
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
Expand Down Expand Up @@ -46,7 +46,7 @@
<ItemGroup>
<PackageReference Include="NewLife.IP" Version="2.2.2024.1102" />
<PackageReference Include="NewLife.Redis" Version="6.0.2024.1101" />
<PackageReference Include="NewLife.Remoting.Extensions" Version="3.0.2024.1101" />
<PackageReference Include="NewLife.Remoting.Extensions" Version="3.2.2024.1113" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Stardust.ServerTests/Stardust.ServerTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputPath>..\Bin\ServerTest</OutputPath>

<IsPackable>false</IsPackable>
Expand All @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down
4 changes: 2 additions & 2 deletions Stardust.Web/Stardust.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>StarWeb</AssemblyName>
<AssemblyTitle>星尘管理平台</AssemblyTitle>
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
Expand Down Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="NewLife.Cube.Core" Version="6.1.2024.1106" />
<PackageReference Include="NewLife.IP" Version="2.2.2024.1102" />
<PackageReference Include="NewLife.Redis" Version="6.0.2024.1101" />
<PackageReference Include="NewLife.Remoting.Extensions" Version="3.0.2024.1101" />
<PackageReference Include="NewLife.Remoting.Extensions" Version="3.2.2024.1113" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions Stardust/Managers/FrameworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}]");

Expand Down
85 changes: 85 additions & 0 deletions Stardust/Managers/NetRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/// <summary>安装.NET9.0</summary>
/// <param name="target">目标版本。包括子版本,如6.0.15</param>
/// <param name="kind">安装类型。如aspnet/desktop/host</param>
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
Expand Down
11 changes: 7 additions & 4 deletions Stardust/Stardust.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>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</TargetFrameworks>
<TargetFrameworks>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</TargetFrameworks>
<AssemblyName>Stardust</AssemblyName>
<AssemblyTitle>星尘分布式服务核心</AssemblyTitle>
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2024 NewLife</Copyright>
<VersionPrefix>3.1</VersionPrefix>
<VersionPrefix>3.2</VersionPrefix>
<VersionSuffix>$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</VersionSuffix>
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
<FileVersion>$(Version)</FileVersion>
Expand Down Expand Up @@ -39,7 +39,7 @@
<PackageReadmeFile>Readme.MD</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-windows' or '$(TargetFramework)'=='net7.0-windows' or '$(TargetFramework)'=='net8.0-windows'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-windows' or '$(TargetFramework)'=='net7.0-windows' or '$(TargetFramework)'=='net8.0-windows' or '$(TargetFramework)'=='net9.0-windows'">
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

Expand Down Expand Up @@ -70,6 +70,9 @@
<ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows'">
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" TargetingPackVersion="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net9.0-windows'">
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" TargetingPackVersion="9.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Managers\ServiceController.cs" />
Expand Down Expand Up @@ -114,7 +117,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Remoting" Version="3.1.2024.1101" />
<PackageReference Include="NewLife.Remoting" Version="3.2.2024.1113" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NewLife.Core" Version="11.0.2024.1113" />
Expand Down
2 changes: 1 addition & 1 deletion Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyVersion>1.0.*</AssemblyVersion>
<Deterministic>false</Deterministic>
<OutputPath>..\Bin\Test</OutputPath>
Expand Down

0 comments on commit c7da851

Please sign in to comment.