From b753830877a65617c47e9b05c65e3b0dcba3522b Mon Sep 17 00:00:00 2001 From: Zaldaryon <273555259+Zaldaryon@users.noreply.github.com> Date: Fri, 20 Nov 2026 13:53:58 -0300 Subject: [PATCH 1/2] fix(release): probe patched build output first in Windows runtime donor build The Windows donor script searched the vanilla donor snapshot before bin/Release, so Resolve-ProjectReferences replaced the patched VintagestoryAPI.dll hint with the unpatched one and VSSurvivalMod failed to compile in the v0.4.1 overlay run. Match the bash script's order and add a regression test. --- .../installer-release-coverage-tests.cs | 24 +++++++++++++++++++ scripts/prepare-runtime-donors.ps1 | 6 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Optimum.Tests/installer-release-coverage-tests.cs b/Optimum.Tests/installer-release-coverage-tests.cs index 0bbab0a6..f797c8a8 100644 --- a/Optimum.Tests/installer-release-coverage-tests.cs +++ b/Optimum.Tests/installer-release-coverage-tests.cs @@ -512,6 +512,30 @@ public void RuntimePatchesHaveASeparateExactDonorPipeline() Assert.Contains("Test-PatchSyntax", Read("scripts/bootstrap.ps1")); } + [Fact] + public void RuntimeDonorReferenceResolutionPrefersPatchedBuildOutput() + { + // The vanilla donor snapshot holds an unpatched VintagestoryAPI.dll. If + // it is probed before the build output, the Windows donor build loses + // Optimum-only API members (v0.4.1 overlay failure). + string bash = Read("scripts/prepare-runtime-donors.sh"); + string powershell = Read("scripts/prepare-runtime-donors.ps1"); + + int bashOutput = bash.IndexOf("my @dirs = ($ENV{OUTPUT_ROOT},", StringComparison.Ordinal); + int bashDonor = bash.IndexOf("\"$ENV{RUNTIME_DONOR_DIR}/Lib\"", bashOutput, StringComparison.Ordinal); + Assert.True(bashOutput >= 0 && bashDonor > bashOutput, "Bash must probe the build output before the donor directories"); + + Match search = Regex.Match( + powershell, + @"\$searchPaths = @\((?.*?)\r?\n\s*\)", + RegexOptions.Singleline); + Assert.True(search.Success, "PowerShell search path list is missing"); + string body = search.Groups["body"].Value; + int psOutput = body.IndexOf("$outputRoot", StringComparison.Ordinal); + int psDonor = body.IndexOf("$runtimeDonorDir", StringComparison.Ordinal); + Assert.True(psOutput >= 0 && psDonor > psOutput, "PowerShell must probe the build output before the donor directories"); + } + [Fact] public void RuntimeDonorPreparationUsesProtectedVanillaSnapshot() { diff --git a/scripts/prepare-runtime-donors.ps1 b/scripts/prepare-runtime-donors.ps1 index a3288865..e2ba4f89 100644 --- a/scripts/prepare-runtime-donors.ps1 +++ b/scripts/prepare-runtime-donors.ps1 @@ -378,11 +378,13 @@ function Resolve-ProjectReferences { param([string]$ProjectFile) $text = [IO.File]::ReadAllText($ProjectFile) $projectDir = Split-Path -Parent $ProjectFile + # The patched build output must win over the vanilla donor snapshot, which + # also contains VintagestoryAPI.dll. Matches resolve_references in the .sh. $searchPaths = @( + $outputRoot, (Join-Path $runtimeDonorDir 'Lib'), $runtimeDonorDir, - (Join-Path $runtimeDonorDir 'Mods'), - $outputRoot + (Join-Path $runtimeDonorDir 'Mods') ) # Pass 1: Self-closing references without HintPath $text = [regex]::Replace($text, '', { From 50398791adbb39b2c6dfd227626cb86189674ff1 Mon Sep 17 00:00:00 2001 From: Zaldaryon <273555259+Zaldaryon@users.noreply.github.com> Date: Fri, 20 Nov 2026 13:53:58 -0300 Subject: [PATCH 2/2] ci(release): let overlays be rebuilt for an existing release tag Add workflow_dispatch with a tag input so overlays missing from a published release can be built and attached without moving the tag. --- .github/workflows/release-overlay.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-overlay.yml b/.github/workflows/release-overlay.yml index 9b37b992..de04ef47 100644 --- a/.github/workflows/release-overlay.yml +++ b/.github/workflows/release-overlay.yml @@ -3,12 +3,18 @@ name: Release RiftLauncher overlays on: release: types: [published] + workflow_dispatch: + inputs: + tag: + description: Existing release tag to build and attach overlays for (for example v0.4.1) + required: true + type: string permissions: contents: write concurrency: - group: release-overlay-${{ github.event.release.tag_name }} + group: release-overlay-${{ inputs.tag || github.event.release.tag_name }} cancel-in-progress: false jobs: @@ -32,7 +38,7 @@ jobs: - name: Resolve release and client versions id: versions env: - RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} shell: bash run: | set -euo pipefail @@ -103,7 +109,7 @@ jobs: - name: Resolve release and client versions id: versions env: - RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} shell: bash run: | set -euo pipefail @@ -172,7 +178,7 @@ jobs: - name: Validate and upload release assets env: GH_TOKEN: ${{ github.token }} - RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} shell: bash run: | set -euo pipefail