forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (Verified + Harvest)
|
||||
name: Build Wownero Core (Verified Harvest)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -100,8 +100,7 @@ jobs:
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/zstd.mk
|
||||
|
||||
# 5. GENERATE BOOST.MK (Standard Mac Config)
|
||||
# We use runtime-link=shared for Darwin because that is the robust way to build portable Mac binaries.
|
||||
# 5. GENERATE BOOST.MK
|
||||
cat <<'EOF' > contrib/depends/packages/boost.mk
|
||||
package=boost
|
||||
$(package)_version=1.90.0
|
||||
@@ -116,17 +115,13 @@ jobs:
|
||||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
||||
|
||||
$(package)_config_opts_linux=threadapi=pthread runtime-link=static
|
||||
|
||||
# Darwin uses shared runtime (system libc++). This is standard for portable static libs.
|
||||
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
|
||||
|
||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||
$(package)_config_opts_i686_mingw32=address-model=32
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
$(package)_config_opts_x86_64_darwin=address-model=64
|
||||
|
||||
# MACOS ARM FIX
|
||||
$(package)_config_opts_aarch64_darwin=address-model=64 architecture=arm binary-format=mach-o abi=aapcs
|
||||
|
||||
$(package)_toolset_$(host_os)=gcc
|
||||
@@ -162,14 +157,10 @@ jobs:
|
||||
PREFIX=$(pwd)/contrib/depends/${{ matrix.target }}
|
||||
mkdir build && cd build
|
||||
|
||||
# Fix strptime
|
||||
export CXXFLAGS="-D_GNU_SOURCE"
|
||||
export CFLAGS="-D_GNU_SOURCE"
|
||||
|
||||
# DEFAULT FLAGS
|
||||
STATIC_RUNTIME="ON"
|
||||
|
||||
# MAC SPECIFIC FIX
|
||||
if [[ "${{ matrix.target }}" == *"apple"* ]]; then
|
||||
STATIC_RUNTIME="OFF"
|
||||
perl -pi -e 's/locale//g' ../CMakeLists.txt
|
||||
@@ -184,27 +175,20 @@ jobs:
|
||||
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Package Artifacts
|
||||
- name: Package Artifacts (Harvest Missing Libs)
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
# This directory contains the raw build output before installation
|
||||
WORK_DIR="contrib/depends/work"
|
||||
|
||||
mkdir -p output/lib output/include output/bin
|
||||
|
||||
# 1. Copy Binaries
|
||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||
cp -v $LIB_DIR/*.a output/lib/ || true
|
||||
|
||||
# 2. Copy Standard Libs (Boost, OpenSSL, etc.)
|
||||
cp -v $LIB_DIR/*.a output/lib/
|
||||
|
||||
# 3. HARVEST MISSING LIBS (The "Search & Destroy" Fix)
|
||||
# If zlib/zstd aren't in the lib folder, find them in the work directory and copy them.
|
||||
|
||||
# HARVESTING: Search entire work tree if missing
|
||||
if [ ! -f output/lib/libz.a ]; then
|
||||
echo "Harvesting libz.a..."
|
||||
# Find standard or static named lib, take the first one found
|
||||
find $WORK_DIR -name "libz.a" -o -name "libz_static.a" | head -n 1 | xargs -I {} cp -v {} output/lib/libz.a
|
||||
fi
|
||||
|
||||
@@ -213,11 +197,9 @@ jobs:
|
||||
find $WORK_DIR -name "libzstd.a" -o -name "libzstd_static.a" | head -n 1 | xargs -I {} cp -v {} output/lib/libzstd.a
|
||||
fi
|
||||
|
||||
# 4. Final Verification (Fail the job if they are still missing)
|
||||
if [ ! -f output/lib/libzstd.a ]; then echo "FATAL: libzstd.a missing"; exit 1; fi
|
||||
if [ ! -f output/lib/libz.a ]; then echo "FATAL: libz.a missing"; exit 1; fi
|
||||
echo "=== ARTIFACT CONTENTS ==="
|
||||
ls -l output/lib/
|
||||
|
||||
# 5. Copy Headers
|
||||
cp -r src output/include/wownero-src
|
||||
cp -r $INC_DIR/* output/include/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user