Merge base branch and resolve packaging conflict

Incorporated validation logic from base branch while keeping the deduplication fix. The resolution:
- Keeps validation to check required binaries exist before packaging
- Removes explicit zip command with hardcoded binary list (avoiding duplication)
- Uses only the loop to add all executables
- Keeps post-creation validation
This commit is contained in:
copilot-swe-agent[bot] 2026-01-24 19:26:54 +00:00
commit 8e13d89033

View File

@ -44,12 +44,45 @@ jobs:
- name: Package binaries
run: |
cd build/bin
# Verify that critical binaries exist
REQUIRED_BINARIES=(world zone ucs queryserv eqlaunch shared_memory loginserver import_client_files export_client_files)
MISSING_BINARIES=()
for binary in "${REQUIRED_BINARIES[@]}"; do
if [ ! -f "$binary" ]; then
MISSING_BINARIES+=("$binary")
fi
done
if [ ${#MISSING_BINARIES[@]} -ne 0 ]; then
echo "Error: Required binaries not found: ${MISSING_BINARIES[*]}"
echo "Build may have failed. Refusing to create incomplete package."
exit 1
fi
# Add all executable files (excluding tests)
for f in *; do
if [ -f "$f" ] && [ -x "$f" ] && [ "$f" != "tests" ]; then
zip -uj eqemu-server-linux-x64.zip "$f"
fi
done
# Verify zip file was created and contains files
if [ ! -f eqemu-server-linux-x64.zip ]; then
echo "Error: Failed to create zip file"
exit 1
fi
FILE_COUNT=$(unzip -Z1 eqemu-server-linux-x64.zip | wc -l)
EXPECTED_MIN_FILES=${#REQUIRED_BINARIES[@]}
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
exit 1
fi
echo "Successfully packaged $FILE_COUNT files"
ls -la eqemu-server-linux-x64.zip
- name: Upload artifact
@ -96,6 +129,25 @@ jobs:
run: |
$binDir = "build/bin/RelWithDebInfo"
$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
$requiredBinaries = @("world.exe", "zone.exe", "ucs.exe", "queryserv.exe", "eqlaunch.exe", "shared_memory.exe")
$missingBinaries = @()
foreach ($binary in $requiredBinaries) {
$path = Join-Path $binDir $binary
if (-not (Test-Path $path)) {
$missingBinaries += $binary
}
}
if ($missingBinaries.Count -gt 0) {
Write-Host "Error: Required binaries not found: $($missingBinaries -join ', ')"
Write-Host "Build may have failed. Refusing to create incomplete package."
exit 1
}
# Collect all exe and dll files
$files = @()
@ -118,12 +170,41 @@ jobs:
}
}
# Verify we have files to package
if ($files.Count -eq 0) {
Write-Host "Error: No files found to package"
exit 1
}
# Create zip
Compress-Archive -Path $files -DestinationPath $outZip -Force
# Verify zip was created successfully
if (-not (Test-Path $outZip)) {
Write-Host "Error: Failed to create zip file"
exit 1
}
# Verify zip contains files (should contain at least the core binaries)
$zipInfo = Get-Item $outZip
if ($zipInfo.Length -lt $minZipSize) {
Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minZipSize)"
exit 1
}
# Show contents
Write-Host "Successfully packaged $($files.Count) files"
Write-Host "Package contents:"
Get-ChildItem $outZip | Format-List
Add-Type -AssemblyName System.IO.Compression.FileSystem
$zip = [System.IO.Compression.ZipFile]::OpenRead($outZip)
try {
foreach ($entry in $zip.Entries) {
Write-Host (" - {0} ({1} bytes)" -f $entry.FullName, $entry.Length)
}
}
finally {
$zip.Dispose()
}
- name: Upload artifact
uses: actions/upload-artifact@v4