ci: use fixed source path across runner steps
Some checks failed
Build Windows Release / Build Windows x64 Release (push) Failing after 24s

This commit is contained in:
luochen570
2026-05-30 21:16:55 +08:00
parent 37ee80e3e7
commit cffa806267

View File

@@ -31,8 +31,10 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'
$work = Join-Path $env:RUNNER_TEMP 'chengnan-src'
$srcFixed = Join-Path $env:RUNNER_TEMP 'chengnan-work'
$zip = Join-Path $env:RUNNER_TEMP 'chengnan-src.zip'
if (Test-Path $work) { Remove-Item -Recurse -Force $work }
if (Test-Path $srcFixed) { Remove-Item -Recurse -Force $srcFixed }
if (Test-Path $zip) { Remove-Item -Force $zip }
New-Item -ItemType Directory -Force -Path $work | Out-Null
@@ -44,8 +46,8 @@ jobs:
$src = Get-ChildItem -Path $work -Directory | Select-Object -First 1
if (-not $src) { throw 'Source archive extraction produced no directory' }
"SOURCE_DIR=$($src.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Write-Host "Source dir: $($src.FullName)"
Copy-Item -Path $src.FullName -Destination $srcFixed -Recurse -Force
Write-Host "Source dir: $srcFixed"
- name: Install MSYS2 and build dependencies
shell: powershell
@@ -73,7 +75,8 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'
$bash = "$env:MSYS2_ROOT\usr\bin\bash.exe"
$src = $env:SOURCE_DIR -replace '\\','/'
$srcWin = Join-Path $env:RUNNER_TEMP 'chengnan-work'
$src = $srcWin -replace '\\','/'
$src = $src -replace '^([A-Za-z]):','/$1'
$src = $src.ToLower()
$script = @"