Guard ccache and avoid lib name collisions

Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-25 00:42:42 +00:00
parent d27e901421
commit 9e220a05c5
2 changed files with 18 additions and 2 deletions

View File

@ -24,6 +24,13 @@ jobs:
with:
key: ${{ runner.os }}-ccache-${{ hashFiles('CMakeLists.txt', '.github/workflows/build.yaml') }}
- name: Ensure ccache installed
run: |
if ! command -v ccache >/dev/null 2>&1; then
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ccache
fi
- name: Mark workspace safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

View File

@ -71,6 +71,15 @@ jobs:
zip_add() {
zip -uj eqemu-server-linux-x64.zip "$1"
}
zip_add_unique() {
local target_name
target_name="$(basename "$1")"
if unzip -Z1 eqemu-server-linux-x64.zip | grep -qx "$target_name"; then
echo "Skipping duplicate library: $target_name"
return 0
fi
zip_add "$1"
}
# Add all executable files (excluding tests)
for f in *; do
@ -84,7 +93,7 @@ jobs:
if [ "$bin_lib_count" -gt 0 ]; then
find . -maxdepth 1 -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
while IFS= read -r -d '' lib; do
zip_add "$lib"
zip_add_unique "$lib"
done
fi
@ -93,7 +102,7 @@ jobs:
if [ "$lib_count" -gt 0 ]; then
find ../libs -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
while IFS= read -r -d '' lib; do
zip_add "$lib"
zip_add_unique "$lib"
done
else
echo "No shared libraries found in build/libs"