Skip to content

Commit c2ec076

Browse files
committed
cleanup
1 parent 8a4c0b6 commit c2ec076

1 file changed

Lines changed: 16 additions & 27 deletions

File tree

.github/workflows/windows-build.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,27 @@ jobs:
5656
shell: pwsh
5757
run: |
5858
$runDir = "$env:GITHUB_WORKSPACE\Run"
59-
$dataDir = "$runDir"
6059
$testsDir = "$runDir\Tests"
61-
$buildExe = "$env:GITHUB_WORKSPACE\Projects\VS\${{ matrix.configuration }}\openfodder.exe"
62-
$buildDir = "$env:GITHUB_WORKSPACE\Projects\VS\${{ matrix.configuration }}"
63-
New-Item -ItemType Directory -Path $runDir -Force | Out-Null
64-
if (-not (Test-Path $buildExe)) {
65-
Write-Error "Built executable not found at $buildExe"
66-
exit 1
67-
}
68-
Copy-Item $buildExe -Destination "$runDir\openfodder.exe" -Force
69-
Copy-Item "$buildDir\SDL3.dll" -Destination $runDir -Force
70-
Copy-Item "$buildDir\SDL3_mixer.dll" -Destination $runDir -Force
71-
if (Test-Path "$dataDir\.git") {
72-
git -C $dataDir pull
73-
} else {
74-
if (Test-Path $dataDir) { Remove-Item $dataDir -Recurse -Force }
75-
git clone --single-branch https://github.com/OpenFodder/data.git $dataDir
76-
}
77-
if (Test-Path "$testsDir\.git") {
78-
git -C $testsDir pull
79-
} else {
80-
if (Test-Path $testsDir) { Remove-Item $testsDir -Recurse -Force }
81-
git clone https://github.com/OpenFodder/tests.git $testsDir
82-
}
60+
$stashDir = "$env:RUNNER_TEMP\openfodder-runtime"
8361
$ffmpegBin = "$env:GITHUB_WORKSPACE\vcpkg_installed\${{ matrix.vcpkg_triplet }}\bin"
62+
8463
if (-not (Test-Path $ffmpegBin)) {
8564
$ffmpegBin = "C:\vcpkg\installed\${{ matrix.vcpkg_triplet }}\bin"
8665
}
87-
if (-not (Test-Path $ffmpegBin)) {
88-
Write-Error "FFmpeg binaries not found in vcpkg_installed or C:\vcpkg\installed for ${{ matrix.vcpkg_triplet }}."
89-
exit 1
90-
}
66+
67+
New-Item -ItemType Directory -Path $stashDir -Force | Out-Null
68+
Copy-Item "$runDir\openfodder.exe" -Destination $stashDir -Force -ErrorAction SilentlyContinue
69+
Copy-Item "$runDir\SDL3.dll" -Destination $stashDir -Force -ErrorAction SilentlyContinue
70+
Copy-Item "$runDir\SDL3_mixer.dll" -Destination $stashDir -Force -ErrorAction SilentlyContinue
71+
72+
git clone --single-branch https://github.com/OpenFodder/data.git $runDir
73+
74+
Copy-Item "$stashDir\openfodder.exe" -Destination $runDir -Force
75+
Copy-Item "$stashDir\SDL3.dll" -Destination $runDir -Force
76+
Copy-Item "$stashDir\SDL3_mixer.dll" -Destination $runDir -Force
77+
78+
git clone https://github.com/OpenFodder/tests.git $testsDir
79+
9180
Copy-Item "$ffmpegBin\avcodec*.dll" -Destination $runDir -Force
9281
Copy-Item "$ffmpegBin\avformat*.dll" -Destination $runDir -Force
9382
Copy-Item "$ffmpegBin\avutil*.dll" -Destination $runDir -Force

0 commit comments

Comments
 (0)