Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/release-overlay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions Optimum.Tests/installer-release-coverage-tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @\((?<body>.*?)\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()
{
Expand Down
6 changes: 4 additions & 2 deletions scripts/prepare-runtime-donors.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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, '<Reference Include="([^"]+)"\s*/>', {
Expand Down
Loading