Skip to content

Commit

Permalink
Merge branch 'upcoming' into upcoming-nuget-release
Browse files Browse the repository at this point in the history
  • Loading branch information
SignatureBeef committed Jan 2, 2025
2 parents 2b11220 + 21815e0 commit 0ad323d
Show file tree
Hide file tree
Showing 48 changed files with 1,123 additions and 903 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,26 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x' # SDK Version to use; x will use the latest version of the 3.1 channel
dotnet-version: '9.0.x' # SDK Version to use; x will use the latest version of the 3.1 channel

# - name: MonoMod dev build
# run: dotnet nuget add source https://pkgs.dev.azure.com/MonoMod/MonoMod/_packaging/DevBuilds%40Local/nuget/v3/index.json -n DevBuilds@Local

- name: Build
run: |
cd OTAPI.Client.Launcher
dotnet publish -r ${{ matrix.profile.runtime_identifier }} --framework net6.0 -p:PublishReadyToRun=true --self-contained false -c Release
dotnet publish -r ${{ matrix.profile.runtime_identifier }} --framework net9.0 -p:PublishReadyToRun=true --self-contained false -c Release
if ${{ matrix.profile.runs_on != 'macos-latest' }} ; then
7z a ../${{ matrix.profile.archive_name }} './bin/Release/net6.0/${{ matrix.profile.runtime_identifier }}/publish/*'
7z a ../${{ matrix.profile.archive_name }} './bin/Release/net9.0/${{ matrix.profile.runtime_identifier }}/publish/*'
else
mkdir -p OTAPI.app/Contents/Resources
mv bin/Release/net6.0/osx-x64/publish OTAPI.app/Contents/MacOS
mv bin/Release/net9.0/osx-x64/publish OTAPI.app/Contents/MacOS
cp ../docs/MacOS.Info.plist OTAPI.app/Contents/Info.plist
cp OTAPI.osx.sh OTAPI.app/Contents/MacOS/OTAPI
chmod +x OTAPI.app/Contents/MacOS/OTAPI
Expand All @@ -85,7 +85,7 @@ jobs:
# - uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.profile.name }} Launcher
# path: OTAPI.Client.Launcher/bin/Release/net6.0/${{ matrix.profile.runtime_identifier }}/publish
# path: OTAPI.Client.Launcher/bin/Release/net9.0/${{ matrix.profile.runtime_identifier }}/publish

- uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,38 @@ jobs:
name: ${{ matrix.profile.name }} Server

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '9.0.x'

- name: Build the project
run: |
dotnet build OTAPI.Mods.slnf
(cd OTAPI.Patcher/bin/Debug/net6.0 && exec dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net6.0)
(cd OTAPI.Patcher/bin/Debug/net9.0 && exec dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net9.0)
dotnet build OTAPI.Server.Launcher.slnf
(cd OTAPI.Server.Launcher/bin/Debug/net6.0 && exec dotnet OTAPI.Server.Launcher.dll -test-init)
(cd OTAPI.Server.Launcher/bin/Debug/net9.0 && exec dotnet OTAPI.Server.Launcher.dll -test-init)
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} NuGet Package
path: OTAPI.Patcher/bin/Debug/net6.0/${{ matrix.profile.package_path }}
path: OTAPI.Patcher/bin/Debug/net9.0/${{ matrix.profile.package_path }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Binaries
path: |
OTAPI.Patcher/bin/Debug/net6.0/artifact-*/*
OTAPI.Patcher/bin/Debug/net9.0/artifact-*/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Wiki MD files
path: OTAPI.Patcher/bin/Debug/net6.0/*.mfw.md
path: OTAPI.Patcher/bin/Debug/net9.0/*.mfw.md

- name: "Releasing to NuGet: ${{ matrix.profile.name }}"
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push OTAPI.Patcher/bin/Debug/net6.0/${{ matrix.profile.package_path }} --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY"
run: dotnet nuget push OTAPI.Patcher/bin/Debug/net9.0/${{ matrix.profile.package_path }} --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY"
65 changes: 42 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ on:
jobs:

Server:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: [
{
name: Windows,
runs-on: windows-latest,
},
{
name: Ubuntu,
runs-on: ubuntu-latest,
},
{
name: macOS,
runs-on: macos-latest,
}
]
profile: [
{
name: PC,
Expand All @@ -31,43 +43,50 @@ jobs:
patch_target: m,
package_path: OTAPI.Mobile.nupkg,
},
{
name: tModLoader,
patch_target: t,
package_path: OTAPI.TML.nupkg,
},
# { this is ultimately not supported yet, consideration in future when time permits
# name: tModLoader,
# patch_target: t,
# package_path: OTAPI.TML.nupkg,
# },
]

runs-on: ${{ matrix.os.runs-on }}

name: ${{ matrix.profile.name }} Server
name: ${{ matrix.os.name }} ${{ matrix.profile.name }} Server

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '9.0.x'

- name: Build the project
- name: Server patch
run: |
dotnet build OTAPI.Mods.slnf
(cd OTAPI.Patcher/bin/Debug/net6.0 && exec dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net6.0)
cd OTAPI.Patcher/bin/Debug/net9.0
dotnet run --project ../../../OTAPI.Patcher.csproj -patchTarget=${{ matrix.profile.patch_target }} -latest=n --framework net9.0
- name: Server boot
run: |
dotnet build OTAPI.Server.Launcher.slnf
(cd OTAPI.Server.Launcher/bin/Debug/net6.0 && exec dotnet OTAPI.Server.Launcher.dll -test-init)
cd OTAPI.Server.Launcher/bin/Debug/net9.0
dotnet OTAPI.Server.Launcher.dll -test-init
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} NuGet Package
path: OTAPI.Patcher/bin/Debug/net6.0/${{ matrix.profile.package_path }}
name: ${{ matrix.os.name }} ${{ matrix.profile.name }} NuGet Package
path: OTAPI.Patcher/bin/Debug/net9.0/${{ matrix.profile.package_path }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Binaries
name: ${{ matrix.os.name }} ${{ matrix.profile.name }} Binaries
path: |
OTAPI.Patcher/bin/Debug/net6.0/artifact-*/*
OTAPI.Patcher/bin/Debug/net9.0/artifact-*/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile.name }} Wiki MD files
path: OTAPI.Patcher/bin/Debug/net6.0/*.mfw.md
name: ${{ matrix.os.name }} ${{ matrix.profile.name }} Wiki MD files
path: OTAPI.Patcher/bin/Debug/net9.0/*.mfw.md
50 changes: 9 additions & 41 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,20 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Setup (Vanilla)",
"type": "coreclr",
"name": "C#: Patcher Debug",
"type": "dotnet",
"request": "launch",
"preLaunchTask": "build-setup",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/OTAPI.Setup/bin/Debug/net6.0/OTAPI.Setup.dll",
"args": ["-patchTarget=v", "-latestVanilla=n"],
"cwd": "${workspaceFolder}/OTAPI.Setup/bin/Debug/net6.0/",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
"projectPath": "${workspaceFolder}/OTAPI.Patcher/OTAPI.Patcher.csproj"
},
{
"name": "Patcher (Vanilla)",
"type": "coreclr",
"name": "C#: Server Launcher Debug",
"type": "dotnet",
"request": "launch",
"preLaunchTask": "build-mods",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/OTAPI.Patcher/bin/Debug/net6.0/OTAPI.Patcher.dll",
"args": ["-patchTarget=v", "-latestVanilla=n"],
"cwd": "${workspaceFolder}/OTAPI.Patcher/bin/Debug/net6.0/",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Launcher (Vanilla)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-launcher",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/OTAPI.Launcher/bin/Debug/net6.0/OTAPI.Launcher.dll",
"args": ["-patchTarget=v", "-latestVanilla=n"],
"cwd": "${workspaceFolder}/OTAPI.Launcher/bin/Debug/net6.0/", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "externalTerminal",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
"projectPath": "${workspaceFolder}/OTAPI.Server.Launcher/OTAPI.Server.Launcher.csproj"
}
]
}
66 changes: 0 additions & 66 deletions .vscode/tasks.json

This file was deleted.

2 changes: 1 addition & 1 deletion FNA
Submodule FNA updated 328 files
13 changes: 6 additions & 7 deletions OTAPI.Client.Launcher/Actions/OTAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace OTAPI.Client.Launcher.Actions;

static class OTAPI
{
static Assembly Terraria;
static Assembly? Terraria;

static void CompileAndInstall() //considering to keep or not. this can recompile OTAPI mods on launch...which will be great for developing it. will look into when i get back to it one day
{
Expand Down Expand Up @@ -114,7 +114,6 @@ public static void Launch(string[] args)

GC.Collect();


CSharpLoader.OnCompilationContext += CSharpLoader_OnCompilationContext;

AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
Expand Down Expand Up @@ -232,7 +231,7 @@ static string ResolveFile(string path)
using var stream = root.GetManifestResourceStream(text);
if (stream is null) return null;
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
stream.ReadExactly(array);
stream.Seek(0, SeekOrigin.Begin);

// if (!File.Exists(resourceName))
Expand Down Expand Up @@ -267,10 +266,10 @@ static IntPtr ResolveNativeDep(string libraryName, Assembly assembly, DllImportS
IEnumerable<string> matches = Enumerable.Empty<string>();

foreach (var basePath in new[] {
Environment.CurrentDirectory,
AppContext.BaseDirectory,
Path.Combine(Environment.CurrentDirectory, "client")
})
Environment.CurrentDirectory,
AppContext.BaseDirectory,
Path.Combine(Environment.CurrentDirectory, "client")
})
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Expand Down
7 changes: 5 additions & 2 deletions OTAPI.Client.Launcher/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
<Application.Resources>
<themes:BundledTheme BaseTheme="Light" PrimaryColor="Teal" SecondaryColor="Amber"/>
</Application.Resources>
<Application.Styles>
<!--<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
<StyleInclude Source="avares://Material.Avalonia/Material.Avalonia.Templates.xaml" />
</Application.Styles>
</Application.Styles>-->
<Application.Styles>
<themes:MaterialTheme BaseTheme="Dark" PrimaryColor="Purple" SecondaryColor="Lime" />
</Application.Styles>
</Application>
Loading

0 comments on commit 0ad323d

Please sign in to comment.