Skip to content
Merged
Changes from 4 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
38 changes: 37 additions & 1 deletion .github/workflows/windows_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,48 @@ jobs:
working-directory: ${{ github.workspace }}

- name: Use .NET 8.x
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.x'
env:
PROCESSOR_ARCHITECTURE: x86 # x86 .NET

- name: Prefer x86 dotnet on PATH
shell: pwsh
run: |
$x86DotnetDir = 'C:\Program Files (x86)\dotnet'
$x64DotnetDir = 'C:\Program Files\dotnet'
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
Write-Host "Machine PATH: $machinePath"
Comment thread
eserscor marked this conversation as resolved.

$pathEntries = @($env:PATH -split ';' | Where-Object { $_ })
$reorderedPathEntries = @(
$x86DotnetDir
$pathEntries | Where-Object { $_ -ne $x86DotnetDir }
Comment thread
eserscor marked this conversation as resolved.
)

$env:PATH = ($reorderedPathEntries -join ';')
Add-Content -Path $env:GITHUB_PATH -Value $x86DotnetDir

Comment thread
eserscor marked this conversation as resolved.
Outdated
$dotnetPaths = @(Get-Command dotnet -All | Select-Object -ExpandProperty Source -Unique)
Write-Host 'Resolved dotnet executables:'
$dotnetPaths | ForEach-Object { Write-Host $_ }

$x86DotnetExe = "$x86DotnetDir\dotnet.exe"
$x64DotnetExe = "$x64DotnetDir\dotnet.exe"
$x86Index = $dotnetPaths.IndexOf($x86DotnetExe)
$x64Index = $dotnetPaths.IndexOf($x64DotnetExe)
Comment thread
eserscor marked this conversation as resolved.

if ($x86Index -lt 0) {
throw "Expected x86 dotnet executable was not found: $x86DotnetExe"
}
Comment thread
eserscor marked this conversation as resolved.

if ($x64Index -ge 0 -and $x86Index -gt $x64Index) {
throw "x86 dotnet must appear before x64 dotnet on PATH. Found $x86DotnetExe after $x64DotnetExe."
}

where dotnet
Comment thread
eserscor marked this conversation as resolved.
Outdated

- name: Use Nuget 6.x
uses: nuget/setup-nuget@v2
with:
Expand Down
Loading