mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 05:18:40 +00:00
Guard ccache and avoid lib name collisions
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
key: ${{ runner.os }}-ccache-${{ hashFiles('CMakeLists.txt', '.github/workflows/build.yaml') }}
|
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
|
- name: Mark workspace safe
|
||||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,15 @@ jobs:
|
|||||||
zip_add() {
|
zip_add() {
|
||||||
zip -uj eqemu-server-linux-x64.zip "$1"
|
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)
|
# Add all executable files (excluding tests)
|
||||||
for f in *; do
|
for f in *; do
|
||||||
@@ -84,7 +93,7 @@ jobs:
|
|||||||
if [ "$bin_lib_count" -gt 0 ]; then
|
if [ "$bin_lib_count" -gt 0 ]; then
|
||||||
find . -maxdepth 1 -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
|
find . -maxdepth 1 -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
|
||||||
while IFS= read -r -d '' lib; do
|
while IFS= read -r -d '' lib; do
|
||||||
zip_add "$lib"
|
zip_add_unique "$lib"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -93,7 +102,7 @@ jobs:
|
|||||||
if [ "$lib_count" -gt 0 ]; then
|
if [ "$lib_count" -gt 0 ]; then
|
||||||
find ../libs -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
|
find ../libs -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \
|
||||||
while IFS= read -r -d '' lib; do
|
while IFS= read -r -d '' lib; do
|
||||||
zip_add "$lib"
|
zip_add_unique "$lib"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "No shared libraries found in build/libs"
|
echo "No shared libraries found in build/libs"
|
||||||
|
|||||||
Reference in New Issue
Block a user