Skip to content

Commit b9c2236

Browse files
add windows fallback
1 parent c7ccc4d commit b9c2236

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,22 @@ jobs:
5252
run: |
5353
cabal build
5454
mkdir -p dist
55-
BIN_PATH=$(cabal list-bin json-to-sql-exe)
56-
if [[ -f "$BIN_PATH" ]]; then
57-
cp "$BIN_PATH" dist/json-to-sql-${{ runner.os == 'Linux' && 'linux' || 'macos' }}
55+
if [ "${{ runner.os }}" == "Windows" ]; then
56+
$BIN_PATH = cabal list-bin json-to-sql-exe
57+
if (Test-Path $BIN_PATH) {
58+
Copy-Item $BIN_PATH dist/json-to-sql-windows.exe
59+
} else {
60+
Write-Error "Error: Executable not found!"
61+
exit 1
62+
}
5863
else
59-
echo "Error: Executable not found!"
60-
exit 1
64+
BIN_PATH=$(cabal list-bin json-to-sql-exe)
65+
if [[ -f "$BIN_PATH" ]]; then
66+
cp "$BIN_PATH" dist/json-to-sql-${{ runner.os == 'Linux' && 'linux' || 'macos' }}
67+
else
68+
echo "Error: Executable not found!"
69+
exit 1
70+
fi
6171
fi
6272
6373
- name: Upload built executables

0 commit comments

Comments
 (0)