mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-05 12:02:25 +00:00
Make validation more maintainable with named constants
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
parent
1b8ab775d3
commit
8fae26133c
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
@ -46,10 +46,10 @@ jobs:
|
|||||||
cd build/bin
|
cd build/bin
|
||||||
|
|
||||||
# Verify that critical binaries exist
|
# Verify that critical binaries exist
|
||||||
REQUIRED_BINARIES="world zone ucs queryserv eqlaunch shared_memory"
|
REQUIRED_BINARIES=(world zone ucs queryserv eqlaunch shared_memory)
|
||||||
MISSING_BINARIES=""
|
MISSING_BINARIES=""
|
||||||
|
|
||||||
for binary in $REQUIRED_BINARIES; do
|
for binary in "${REQUIRED_BINARIES[@]}"; do
|
||||||
if [ ! -f "$binary" ]; then
|
if [ ! -f "$binary" ]; then
|
||||||
MISSING_BINARIES="$MISSING_BINARIES $binary"
|
MISSING_BINARIES="$MISSING_BINARIES $binary"
|
||||||
fi
|
fi
|
||||||
@ -80,8 +80,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
FILE_COUNT=$(unzip -Z1 eqemu-server-linux-x64.zip | wc -l)
|
FILE_COUNT=$(unzip -Z1 eqemu-server-linux-x64.zip | wc -l)
|
||||||
if [ "$FILE_COUNT" -lt 6 ]; then
|
EXPECTED_MIN_FILES=${#REQUIRED_BINARIES[@]}
|
||||||
echo "Error: Zip file contains fewer than expected files ($FILE_COUNT)"
|
if [ "$FILE_COUNT" -lt "$EXPECTED_MIN_FILES" ]; then
|
||||||
|
echo "Error: Zip file contains fewer than expected files ($FILE_COUNT, expected at least $EXPECTED_MIN_FILES)"
|
||||||
unzip -l eqemu-server-linux-x64.zip
|
unzip -l eqemu-server-linux-x64.zip
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -133,6 +134,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$binDir = "build/bin/RelWithDebInfo"
|
$binDir = "build/bin/RelWithDebInfo"
|
||||||
$outZip = "eqemu-server-windows-x64.zip"
|
$outZip = "eqemu-server-windows-x64.zip"
|
||||||
|
# Minimum expected zip size (core binaries should be at least this size)
|
||||||
|
$minZipSize = 100KB
|
||||||
|
|
||||||
# Verify that critical binaries exist
|
# Verify that critical binaries exist
|
||||||
$requiredBinaries = @("world.exe", "zone.exe", "ucs.exe", "queryserv.exe", "eqlaunch.exe", "shared_memory.exe")
|
$requiredBinaries = @("world.exe", "zone.exe", "ucs.exe", "queryserv.exe", "eqlaunch.exe", "shared_memory.exe")
|
||||||
@ -187,11 +190,10 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verify zip contains files (minimum 100KB - should contain at least the core binaries)
|
# Verify zip contains files (should contain at least the core binaries)
|
||||||
$zipInfo = Get-Item $outZip
|
$zipInfo = Get-Item $outZip
|
||||||
$minSize = 100KB
|
if ($zipInfo.Length -lt $minZipSize) {
|
||||||
if ($zipInfo.Length -lt $minSize) {
|
Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minZipSize)"
|
||||||
Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minSize)"
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user