From 73f5f75ac8e6f1581b6f09c78319beb9f9a5e3ce Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:16:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat!:=20=F0=9F=8E=89=20Build=20for=20THE?= =?UTF-8?q?=20SPLITTENING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .codex/setup.sh | 3 -- .config/dotnet-tools.json | 10 ---- .github/workflows/build.yml | 54 +++++++++++++++++++ .github/workflows/static-check.yml | 8 ++- .vscode/tasks.json | 18 +++++++ AGENTS.md | 6 +-- Directory.Build.props | 12 ++--- Directory.Build.targets | 2 +- README.md | 10 ++-- .../TurboAudioStream.PrePatcher.csproj | 35 ++++++++++++ TurboAudioStream/TurboAudioStreamMod.cs | 12 +++-- 11 files changed, 136 insertions(+), 34 deletions(-) delete mode 100644 .config/dotnet-tools.json create mode 100644 .github/workflows/build.yml create mode 100644 .vscode/tasks.json create mode 100644 TurboAudioStream.PrePatcher/TurboAudioStream.PrePatcher.csproj diff --git a/.codex/setup.sh b/.codex/setup.sh index fdf056f..7d546b4 100755 --- a/.codex/setup.sh +++ b/.codex/setup.sh @@ -8,8 +8,5 @@ fi export PATH="$PATH:$HOME/.dotnet/tools" -# Restore local tools (including csharpier) -dotnet tool restore || true - # Restore the project dependencies dotnet restore || true diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index bcf27be..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "csharpier": { - "version": "1.0.2", - "commands": ["csharpier"] - } - } -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a7a4477 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: Build + +on: + push: + branches: [ master, main, feature/** ] + pull_request: + branches: [ master, main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Resonite environment + id: build-env + uses: resonite-modding-group/setup-resonite-env-action@v0.1.0 + with: + steam-user: ${{ secrets.STEAMUSER }} + steam-password: ${{ secrets.STEAMPASS }} + + - name: Install ResoniteModLoader and Harmony + shell: bash + run: | + set -euo pipefail + LIBS_PATH='${{ steps.build-env.outputs.libraries-path }}' + RESONITE_DIR="$(dirname "${LIBS_PATH}")" + mkdir -p "${LIBS_PATH}" "${RESONITE_DIR}/rml_libs" + echo "Libraries: ${LIBS_PATH}" + echo "Resonite: ${RESONITE_DIR}" + # RML + curl -fsSL -o "${LIBS_PATH}/ResoniteModLoader.dll" \ + https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll + # Harmony (prefer rml_libs, fallback to root) + if ! curl -fsSL -o "${RESONITE_DIR}/rml_libs/0Harmony.dll" \ + https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll; then + curl -fsSL -o "${RESONITE_DIR}/0Harmony.dll" \ + https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll + fi + + - name: Build + shell: bash + run: | + set -euo pipefail + dotnet build ./TurboAudioStream.sln -c Release -v minimal + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: TurboAudioStream + path: | + TurboAudioStream/bin/Release/TurboAudioStream.dll + TurboAudioStream/bin/Release/TurboAudioStream.xml diff --git a/.github/workflows/static-check.yml b/.github/workflows/static-check.yml index 0900d98..b035436 100644 --- a/.github/workflows/static-check.yml +++ b/.github/workflows/static-check.yml @@ -15,7 +15,7 @@ on: - ci/* jobs: - csharpier: + formatting: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -23,7 +23,5 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - - name: Restore tools - run: dotnet tool restore - - name: Run csharpier check - run: dotnet csharpier check . + - name: Run dotnet format (verify) + run: dotnet format --verify-no-changes diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..bc5654d --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,18 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "format:verify", + "type": "shell", + "command": "dotnet", + "args": [ + "format", + "--verify-no-changes" + ], + "problemMatcher": [ + "$msCompile" + ], + "group": "build" + } + ] +} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 31b409a..5933025 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,6 @@ The CI workflow uses static checks that do not require Resonite assemblies. -- Formatting is enforced with `csharpier`. -- Before committing, run `dotnet csharpier check .` to verify formatting. -- Use `dotnet csharpier format .` to apply formatting fixes. +- Formatting is enforced with `dotnet format`. +- Before committing, run `dotnet format --verify-no-changes` to verify formatting. +- Use `dotnet format` to apply formatting fixes. diff --git a/Directory.Build.props b/Directory.Build.props index 549d902..56d1fab 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,7 +15,7 @@ - net472 + net9.0 latest enable true @@ -56,16 +56,16 @@ - $(ResonitePath)Resonite_Data\Managed\ + $(ResonitePath)/ $(ResonitePath)rml_mods - $(ResonitePath)rml_mods\HotReloadMods - $(ResonitePath)rml_libs\ + $(ResonitePath)rml_mods/HotReloadMods + $(ResonitePath)rml_libs/ - $(ResonitePath)Libraries\ResoniteModLoader.dll + $(ResonitePath)Libraries/ResoniteModLoader.dll false @@ -101,6 +101,6 @@ - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 84c2d93..118eb57 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,7 +10,7 @@ + + + netstandard2.0 + NU1603 + + + + + + + + $(ResoniteManagedPath)FrooxEngine.dll + false + + + $(ResoniteManagedPath)Elements.Core.dll + false + + + $(ResoniteManagedPath)Elements.Assets.dll + false + + + $(ResoniteManagedPath)POpusCodec.dll + false + + + + + $(ResoniteManagedPath)%(Filename).dll + false + + + diff --git a/TurboAudioStream/TurboAudioStreamMod.cs b/TurboAudioStream/TurboAudioStreamMod.cs index 72608b7..86c58bc 100644 --- a/TurboAudioStream/TurboAudioStreamMod.cs +++ b/TurboAudioStream/TurboAudioStreamMod.cs @@ -18,15 +18,21 @@ public sealed class TurboAudioStreamMod : ResoniteMod private static readonly Assembly Assembly = typeof(TurboAudioStreamMod).Assembly; /// - public override string Name => Assembly.GetCustomAttribute().Title; + public override string Name => + Assembly.GetCustomAttribute()?.Title + ?? Assembly.GetName().Name + ?? string.Empty; /// public override string Author => - Assembly.GetCustomAttribute().Company; + Assembly.GetCustomAttribute()?.Company + ?? string.Empty; /// public override string Version => - Assembly.GetCustomAttribute().InformationalVersion; + Assembly.GetCustomAttribute()?.InformationalVersion + ?? Assembly.GetName().Version?.ToString() + ?? "0.0.0"; /// public override string Link => From 7fec08c44605f27cdfa6d95743080f3aa0756a0f Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:28:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Update=20static=20che?= =?UTF-8?q?ck=20workflow=20to=20specify=20whitespace=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/static-check.yml | 4 ++-- AGENTS.md | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static-check.yml b/.github/workflows/static-check.yml index b035436..80b4fe8 100644 --- a/.github/workflows/static-check.yml +++ b/.github/workflows/static-check.yml @@ -23,5 +23,5 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - - name: Run dotnet format (verify) - run: dotnet format --verify-no-changes + - name: Run dotnet format whitespace (verify) + run: dotnet format whitespace --verify-no-changes diff --git a/AGENTS.md b/AGENTS.md index 5933025..694e5a3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,5 @@ The CI workflow uses static checks that do not require Resonite assemblies. -- Formatting is enforced with `dotnet format`. -- Before committing, run `dotnet format --verify-no-changes` to verify formatting. -- Use `dotnet format` to apply formatting fixes. +- CI enforces whitespace-only formatting: `dotnet format whitespace --verify-no-changes`. +- Locally, prefer full checks: `dotnet format --verify-no-changes` and `dotnet format` to fix.