From a49b6f523eb6a26a6e68af2c522fcd6b8ce51cbb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:01:41 +0000 Subject: [PATCH 2/7] Add validation to packaging steps to verify binaries exist Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- .github/workflows/release.yaml | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0e016ce36..9d1ebff76 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,15 +44,49 @@ jobs: - name: Package binaries run: | cd build/bin + + # Verify that critical binaries exist + REQUIRED_BINARIES="world zone ucs queryserv eqlaunch shared_memory" + MISSING_BINARIES="" + + for binary in $REQUIRED_BINARIES; do + if [ ! -f "$binary" ]; then + MISSING_BINARIES="$MISSING_BINARIES $binary" + fi + done + + if [ -n "$MISSING_BINARIES" ]; then + echo "Error: Required binaries not found:$MISSING_BINARIES" + echo "Build may have failed. Refusing to create incomplete package." + exit 1 + fi + + # Create zip with core binaries zip -j eqemu-server-linux-x64.zip \ world zone ucs queryserv eqlaunch shared_memory \ loginserver import_client_files export_client_files + # Include any additional binaries that exist for f in *; do if [ -f "$f" ] && [ -x "$f" ] && [ "$f" != "tests" ]; then zip -u 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 -l eqemu-server-linux-x64.zip | grep -v "Archive:" | grep -v "Length" | grep -v "---" | grep -v "files" | wc -l) + if [ "$FILE_COUNT" -lt 6 ]; then + echo "Error: Zip file contains fewer than expected files ($FILE_COUNT)" + 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 @@ -100,6 +134,23 @@ jobs: $binDir = "build/bin/RelWithDebInfo" $outZip = "eqemu-server-windows-x64.zip" + # 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 = @() @@ -121,10 +172,30 @@ 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 + $zipInfo = Get-Item $outZip + if ($zipInfo.Length -lt 1KB) { + Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes)" + exit 1 + } + # Show contents + Write-Host "Successfully packaged $($files.Count) files" Write-Host "Package contents:" Get-ChildItem $outZip | Format-List From 1b8ab775d3b52c7c349434746bd619dfe4b3155f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:02:21 +0000 Subject: [PATCH 3/7] Improve validation: use unzip -Z1 and increase min size threshold Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- .github/workflows/release.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9d1ebff76..0107e2c2f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -79,7 +79,7 @@ jobs: exit 1 fi - FILE_COUNT=$(unzip -l eqemu-server-linux-x64.zip | grep -v "Archive:" | grep -v "Length" | grep -v "---" | grep -v "files" | wc -l) + FILE_COUNT=$(unzip -Z1 eqemu-server-linux-x64.zip | wc -l) if [ "$FILE_COUNT" -lt 6 ]; then echo "Error: Zip file contains fewer than expected files ($FILE_COUNT)" unzip -l eqemu-server-linux-x64.zip @@ -187,10 +187,11 @@ jobs: exit 1 } - # Verify zip contains files + # Verify zip contains files (minimum 100KB - should contain at least the core binaries) $zipInfo = Get-Item $outZip - if ($zipInfo.Length -lt 1KB) { - Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes)" + $minSize = 100KB + if ($zipInfo.Length -lt $minSize) { + Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minSize)" exit 1 } From 8fae26133cc952d5fc82f718df360ee773dd1772 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:03:15 +0000 Subject: [PATCH 4/7] Make validation more maintainable with named constants Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- .github/workflows/release.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0107e2c2f..0c4af67bd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -46,10 +46,10 @@ jobs: cd build/bin # 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="" - for binary in $REQUIRED_BINARIES; do + for binary in "${REQUIRED_BINARIES[@]}"; do if [ ! -f "$binary" ]; then MISSING_BINARIES="$MISSING_BINARIES $binary" fi @@ -80,8 +80,9 @@ jobs: fi FILE_COUNT=$(unzip -Z1 eqemu-server-linux-x64.zip | wc -l) - if [ "$FILE_COUNT" -lt 6 ]; then - echo "Error: Zip file contains fewer than expected files ($FILE_COUNT)" + 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 @@ -133,6 +134,8 @@ 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") @@ -187,11 +190,10 @@ jobs: 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 - $minSize = 100KB - if ($zipInfo.Length -lt $minSize) { - Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minSize)" + if ($zipInfo.Length -lt $minZipSize) { + Write-Host "Error: Zip file is suspiciously small ($($zipInfo.Length) bytes, expected at least $minZipSize)" exit 1 } From 0ebff2e68e7eeeb50387b1f43f69deb6e6fad335 Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:10:00 -0500 Subject: [PATCH 5/7] Update .github/workflows/release.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c4af67bd..d8b0b89fc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,16 +47,16 @@ jobs: # Verify that critical binaries exist REQUIRED_BINARIES=(world zone ucs queryserv eqlaunch shared_memory) - MISSING_BINARIES="" + MISSING_BINARIES=() for binary in "${REQUIRED_BINARIES[@]}"; do if [ ! -f "$binary" ]; then - MISSING_BINARIES="$MISSING_BINARIES $binary" + MISSING_BINARIES+=("$binary") fi done - if [ -n "$MISSING_BINARIES" ]; then - echo "Error: Required binaries not found:$MISSING_BINARIES" + 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 From 24fb6306ddc1c642d5d87fa8058c138b31477b8e Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:11:16 -0500 Subject: [PATCH 6/7] Update .github/workflows/release.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/release.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d8b0b89fc..ad6b0fb24 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -200,7 +200,16 @@ jobs: # 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 From 4e49ae782b345bf5d5c76a642767278dc075fc00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:13:29 +0000 Subject: [PATCH 7/7] Add loginserver and client_files binaries to validation list Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ad6b0fb24..4ae14ea10 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -46,7 +46,7 @@ jobs: cd build/bin # Verify that critical binaries exist - REQUIRED_BINARIES=(world zone ucs queryserv eqlaunch shared_memory) + REQUIRED_BINARIES=(world zone ucs queryserv eqlaunch shared_memory loginserver import_client_files export_client_files) MISSING_BINARIES=() for binary in "${REQUIRED_BINARIES[@]}"; do