More dotnet versions

This commit is contained in:
UnknownShadow200 2024-03-07 23:07:31 +11:00
parent 556be9e72d
commit c860f64c0e
6 changed files with 66 additions and 14 deletions

View File

@ -39,7 +39,7 @@ jobs:
DEST_NAME: 'MCGalaxy-infid' DEST_NAME: 'MCGalaxy-infid'
build-dotnet: build-dotnet6:
if: github.ref_name == github.event.repository.default_branch if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -50,11 +50,11 @@ jobs:
with: with:
dotnet-version: 6.0.x dotnet-version: 6.0.x
- name: Restore dependencies - name: Restore dependencies
run: dotnet restore CLI/MCGalaxyCLI_dotnet.csproj run: dotnet restore CLI/MCGalaxyCLI_dotnet6.csproj
- name: Build - name: Build
id: compile_net id: compile_net
run: | run: |
dotnet build CLI/MCGalaxyCLI_dotnet.csproj --no-restore dotnet build CLI/MCGalaxyCLI_dotnet6.csproj --no-restore
- uses: ./.github/actions/notify_failure - uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile_net.outcome == 'failure' }} if: ${{ always() && steps.compile_net.outcome == 'failure' }}
@ -70,7 +70,7 @@ jobs:
# publish standalone windows binaries # publish standalone windows binaries
- name: Publish-win64 - name: Publish-win64
run: dotnet publish CLI/MCGalaxyCLI_dotnet.csproj -r win-x64 --self-contained run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r win-x64 --self-contained
- uses: ./.github/actions/upload_build - uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile_net.outcome == 'success' }} if: ${{ always() && steps.compile_net.outcome == 'success' }}
@ -80,7 +80,7 @@ jobs:
# publish standalone linux binaries # publish standalone linux binaries
- name: Publish-linux64 - name: Publish-linux64
run: dotnet publish CLI/MCGalaxyCLI_dotnet.csproj -r linux-x64 --self-contained run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r linux-x64 --self-contained
- uses: ./.github/actions/upload_build - uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile_net.outcome == 'success' }} if: ${{ always() && steps.compile_net.outcome == 'success' }}
@ -90,10 +90,40 @@ jobs:
# publish standalone macOS binaries # publish standalone macOS binaries
- name: Publish-mac64 - name: Publish-mac64
run: dotnet publish CLI/MCGalaxyCLI_dotnet.csproj -r osx-x64 --self-contained run: dotnet publish CLI/MCGalaxyCLI_dotnet6.csproj -r osx-x64 --self-contained
- uses: ./.github/actions/upload_build - uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile_net.outcome == 'success' }} if: ${{ always() && steps.compile_net.outcome == 'success' }}
with: with:
SOURCE_FILE: 'CLI/bin/Debug/net6.0/osx-x64/publish' SOURCE_FILE: 'CLI/bin/Debug/net6.0/osx-x64/publish'
DEST_NAME: 'MCGalaxy-mac64-standalone' DEST_NAME: 'MCGalaxy-mac64-standalone'
build-dotnet8:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore CLI/MCGalaxyCLI_dotnet8.csproj
- name: Build
id: compile_net
run: |
dotnet build CLI/MCGalaxyCLI_dotnet8.csproj --no-restore
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile_net.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile MCGalaxy dotnet build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile_net.outcome == 'success' }}
with:
SOURCE_FILE: 'CLI/bin/Debug/net8.0'
DEST_NAME: 'MCGalaxy-dotnet8.0'

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MCGalaxy\MCGalaxy_dotnet.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MCGalaxy\MCGalaxy_dotnet.csproj" />
</ItemGroup>
</Project>

View File

@ -7,6 +7,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MCGalaxy\MCGalaxy_core.csproj" /> <ProjectReference Include="..\MCGalaxy\MCGalaxy_dotnet.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -77,14 +77,12 @@ Compiling - mono and .NET framework
* Modern mono: Type `msbuild MCGalaxy.sln` into Terminal * Modern mono: Type `msbuild MCGalaxy.sln` into Terminal
* Older mono: Type `xbuild MCGalaxy.sln` into Terminal * Older mono: Type `xbuild MCGalaxy.sln` into Terminal
Compiling - .NET 6 / .NET 5 / .NET Core Compiling - .NET 6 / .NET 7 / .NET 8
----------------- -----------------
* Compiling for .NET 6: No changes necessary * Compiling for .NET 6: Navigate into `CLI` directory, and then run `dotnet build MCGalaxyCLI_dotnet6.csproj`
* Compiling for .NET 5: Change `TargetFramework` in CLI/MCGalaxyCLI_dotnet.csproj to `net5.0` * Compiling for .NET 7: Navigate into `CLI` directory, and then run `dotnet build MCGalaxyCLI_dotnet7.csproj`
* Compiling for .NET Core: Change `TargetFramework` in CLI/MCGalaxyCLI_dotnet.csproj to `netcoreapp3.1` * Compiling for .NET 8: Navigate into `CLI` directory, and then run `dotnet build MCGalaxyCLI_dotnet8.csproj`
Then navigate into `CLI` directory, and then run `dotnet build MCGalaxyCLI_dotnet.csproj`
**You will also need to copy `libsqlite3.so.0` from system libraries to `libsqlite3.so` in the server folder** **You will also need to copy `libsqlite3.so.0` from system libraries to `libsqlite3.so` in the server folder**