Update net6 refs to net9

This commit is contained in:
Luke 2025-01-11 11:19:16 +10:00
parent 0912f690cc
commit 91c578815c
13 changed files with 25 additions and 25 deletions

View file

@ -39,27 +39,27 @@ jobs:
- name: Produce installer - name: Produce installer
run: | run: |
cd TShockInstaller cd TShockInstaller
dotnet publish -r ${{ matrix.arch }} -f net6.0 -c Release -p:PublishSingleFile=true --self-contained true dotnet publish -r ${{ matrix.arch }} -f net9.0 -c Release -p:PublishSingleFile=true --self-contained true
- name: Produce build - name: Produce build
run: | run: |
cd TShockLauncher cd TShockLauncher
dotnet publish -r ${{ matrix.arch }} -f net6.0 -c Release -p:PublishSingleFile=true --self-contained false dotnet publish -r ${{ matrix.arch }} -f net9.0 -c Release -p:PublishSingleFile=true --self-contained false
- name: Chmod scripts - name: Chmod scripts
if: ${{ matrix.arch != 'win-x64' }} if: ${{ matrix.arch != 'win-x64' }}
run: | run: |
chmod +x TShockLauncher/bin/Release/net6.0/${{ matrix.arch }}/publish/TShock.Server chmod +x TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/TShock.Server
- name: Copy installer - name: Copy installer
run: | run: |
cp TShockInstaller/bin/Release/net6.0/${{ matrix.arch }}/publish/* TShockLauncher/bin/Release/net6.0/${{ matrix.arch }}/publish/ cp TShockInstaller/bin/Release/net9.0/${{ matrix.arch }}/publish/* TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/
# preserve file perms: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files # preserve file perms: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
- name: Tarball artifact (non-Windows) - name: Tarball artifact (non-Windows)
if: ${{ matrix.arch != 'win-x64' }} if: ${{ matrix.arch != 'win-x64' }}
run: | run: |
cd TShockLauncher/bin/Release/net6.0/${{ matrix.arch }}/publish/ cd TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/
tar -cvf ../../../../../../TShock-Beta-${{ matrix.arch }}-Release.tar * tar -cvf ../../../../../../TShock-Beta-${{ matrix.arch }}-Release.tar *
- name: Upload artifact (non-Windows) - name: Upload artifact (non-Windows)
@ -74,4 +74,4 @@ jobs:
if: ${{ matrix.arch == 'win-x64' }} if: ${{ matrix.arch == 'win-x64' }}
with: with:
name: TShock-Beta-${{ matrix.arch }}-Release name: TShock-Beta-${{ matrix.arch }}-Release
path: TShockLauncher/bin/Release/net6.0/${{ matrix.arch }}/publish/ path: TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/

6
.vscode/launch.json vendored
View file

@ -9,12 +9,12 @@
"type": "coreclr", "type": "coreclr",
"request": "launch", "request": "launch",
"preLaunchTask": "build", "preLaunchTask": "build",
"program": "${workspaceFolder}/TShockLauncher/bin/Debug/net6.0/TShock.Run.dll", "program": "${workspaceFolder}/TShockLauncher/bin/Debug/net9.0/TShock.Run.dll",
"windows": { "windows": {
"program": "${workspaceFolder}/TShockLauncher/bin/Debug/net6.0/TShock.dll", "program": "${workspaceFolder}/TShockLauncher/bin/Debug/net9.0/TShock.dll",
}, },
"args": [], "args": [],
"cwd": "${workspaceFolder}/TShockLauncher/bin/Debug/net6.0/", "cwd": "${workspaceFolder}/TShockLauncher/bin/Debug/net9.0/",
"console": "integratedTerminal", "console": "integratedTerminal",
"stopAtEntry": false "stopAtEntry": false
}, },

2
.vscode/tasks.json vendored
View file

@ -35,7 +35,7 @@
{ {
"label": "Remote Publish", "label": "Remote Publish",
"options": { "options": {
"cwd": "TShockLauncher/bin/Debug/net6.0/linux-arm64" "cwd": "TShockLauncher/bin/Debug/net9.0/linux-arm64"
}, },
"command": "C:\\Program Files\\PuTTY\\pscp.exe", "command": "C:\\Program Files\\PuTTY\\pscp.exe",
"type": "process", "type": "process",

View file

@ -27,7 +27,7 @@ RUN \
*) echo "Error: Unsupported platform ${TARGETPLATFORM}" && exit 1 \ *) echo "Error: Unsupported platform ${TARGETPLATFORM}" && exit 1 \
;; \ ;; \
esac && \ esac && \
dotnet publish -o output/ -r "${ARCH}" -v m -f net6.0 -c Release -p:PublishSingleFile=true --self-contained false dotnet publish -o output/ -r "${ARCH}" -v m -f net9.0 -c Release -p:PublishSingleFile=true --self-contained false
# Runtime image # Runtime image
FROM --platform=${TARGETPLATFORM} mcr.microsoft.com/dotnet/runtime:6.0 AS runner FROM --platform=${TARGETPLATFORM} mcr.microsoft.com/dotnet/runtime:6.0 AS runner

View file

@ -32,9 +32,9 @@ If you want to run the `TShockLauncher` (which runs a server), run:
To produce a packaged release (suitable for distribution), run: To produce a packaged release (suitable for distribution), run:
1. `cd TShockLauncher` 1. `cd TShockLauncher`
1. `dotnet publish -r win-x64 -f net6.0 -c Release -p:PublishSingleFile=true --self-contained false` 1. `dotnet publish -r win-x64 -f net9.0 -c Release -p:PublishSingleFile=true --self-contained false`
Note that in this example, you'd be building for `win-x64`. You can build for `win-x64`, `osx-x64`, `linux-x64`, `linux-arm64`, `linux-arm`. Your release will be in the `TShockLauncher/bin/Release/net6.0/` folder under the architecture you specified. Note that in this example, you'd be building for `win-x64`. You can build for `win-x64`, `osx-x64`, `linux-x64`, `linux-arm64`, `linux-arm`. Your release will be in the `TShockLauncher/bin/Release/net9.0/` folder under the architecture you specified.
### Working with Terraria ### Working with Terraria

View file

@ -30,9 +30,9 @@ TShock是为泰拉瑞亚服务器和社区开发的一个工具箱。这个工
如果要生成打包后的发行版,运行: 如果要生成打包后的发行版,运行:
1. `cd TShockLauncher` 1. `cd TShockLauncher`
1. `dotnet publish -r win-x64 -f net6.0 -c Release -p:PublishSingleFile=true --self-contained false` 1. `dotnet publish -r win-x64 -f net9.0 -c Release -p:PublishSingleFile=true --self-contained false`
注意在这个例子中你将会生成`win-x64`架构的版本。你也可以生成`win-x64``osx-x64``linux-x64``linux-arm64``linux-arm`的版本。你可以在`TShockLauncher/bin/Release/net6.0/`文件夹下对应架构的文件夹里找到生成后的发行版。 注意在这个例子中你将会生成`win-x64`架构的版本。你也可以生成`win-x64``osx-x64``linux-x64``linux-arm64``linux-arm`的版本。你可以在`TShockLauncher/bin/Release/net9.0/`文件夹下对应架构的文件夹里找到生成后的发行版。
### 跟泰拉瑞亚本体代码交互 ### 跟泰拉瑞亚本体代码交互

View file

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
<!-- <!--

View file

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>5.0.0</Version> <Version>5.0.0</Version>

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyName>TShock.Server</AssemblyName> <!-- TShock was initially decided on by a community poll, however tshock already exists as a folder and will clash --> <AssemblyName>TShock.Server</AssemblyName> <!-- TShock was initially decided on by a community poll, however tshock already exists as a folder and will clash -->
@ -37,15 +37,15 @@
<!-- the launcher doesnt need the direct OTAPI reference, but since PackageReference[ExcludeFromSingleFile] doesnt work, exclude the assets and copy manually --> <!-- the launcher doesnt need the direct OTAPI reference, but since PackageReference[ExcludeFromSingleFile] doesnt work, exclude the assets and copy manually -->
<PackageReference Include="OTAPI.Upcoming" Version="3.1.20" ExcludeAssets="all" GeneratePathProperty="true" /> <PackageReference Include="OTAPI.Upcoming" Version="3.1.20" ExcludeAssets="all" GeneratePathProperty="true" />
<None Include="$(PkgOTAPI_Upcoming)\lib\net6.0\OTAPI.dll"> <None Include="$(PkgOTAPI_Upcoming)\lib\net9.0\OTAPI.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</None> </None>
<None Include="$(PkgOTAPI_Upcoming)\lib\net6.0\OTAPI.Runtime.dll"> <None Include="$(PkgOTAPI_Upcoming)\lib\net9.0\OTAPI.Runtime.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</None> </None>
<None Include="$(PkgModFramework)\lib\net6.0\ModFramework.dll"> <None Include="$(PkgModFramework)\lib\net9.0\ModFramework.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</None> </None>

View file

@ -53,7 +53,7 @@ namespace TShockPluginManager
public Nugetter() public Nugetter()
{ {
FrameworkReducer = new FrameworkReducer(); FrameworkReducer = new FrameworkReducer();
NuGetFramework = NuGetFramework.ParseFolder("net6.0"); NuGetFramework = NuGetFramework.ParseFolder("net9.0");
Settings = NuGet.Configuration.Settings.LoadDefaultSettings(root: null); Settings = NuGet.Configuration.Settings.LoadDefaultSettings(root: null);
PathContext = NuGetPathContext.Create(Settings); PathContext = NuGetPathContext.Create(Settings);
PackageSourceProvider = new PackageSourceProvider(Settings); PackageSourceProvider = new PackageSourceProvider(Settings);

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View file

@ -9,5 +9,5 @@ build_script:
dotnet test dotnet test
artifacts: artifacts:
- path: ./TShockLauncher/bin/Debug/net6.0 - path: ./TShockLauncher/bin/Debug/net9.0
name: TShockAVDebug name: TShockAVDebug