forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (Corrected Dependencies)
|
||||
name: Build Wownero Core (Final & Robust)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -52,17 +52,17 @@ jobs:
|
||||
tar -xf cmake.tar.gz
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Sanitize Makefiles (Strict Static)
|
||||
- name: Sanitize Makefiles (Explicit Order)
|
||||
run: |
|
||||
# 1. RESTORE UPSTREAM FILES
|
||||
curl -L -o contrib/depends/funcs.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/funcs.mk
|
||||
curl -L -o contrib/depends/packages/packages.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/packages/packages.mk
|
||||
|
||||
# 2. INJECT ZLIB/ZSTD
|
||||
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd/' contrib/depends/packages/packages.mk
|
||||
# 2. OVERWRITE PACKAGE LIST (Force Zlib/Zstd FIRST)
|
||||
# We do not use sed here to avoid regex errors. We write the list explicitly.
|
||||
echo "packages := zlib zstd libiconv boost openssl expat libusb hidapi protobuf sodium zeromq unbound" > contrib/depends/packages/packages.mk
|
||||
|
||||
# 3. GENERATE ZLIB.MK (With CMake for better cross-compile support)
|
||||
# We switch to CMake for Zlib to ensure it handles Windows/Cross properly
|
||||
# 3. GENERATE ZLIB.MK (Standard Configure)
|
||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
@@ -70,13 +70,13 @@ jobs:
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF
|
||||
$(package)_config_opts=--static
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
$($(package)_cmake)
|
||||
CHOST=${host} ./configure $($(package)_config_opts) --prefix=$($(package)_staging_prefix_dir)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
$(MAKE) libz.a
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install
|
||||
@@ -149,20 +149,40 @@ jobs:
|
||||
cd contrib/depends
|
||||
make HOST=${{ matrix.target }} -j$(nproc)
|
||||
|
||||
- name: Verify Dependencies (Critical)
|
||||
- name: Verify & Fix Dependencies (Nuclear Option)
|
||||
# If depends failed to produce the files, we build them right here and force them in.
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
echo "Checking $LIB_DIR for critical libraries..."
|
||||
ls -la $LIB_DIR
|
||||
|
||||
# Use find to locate specific files, failing if not found
|
||||
if [ -z "$(find $LIB_DIR -name 'libz*.a')" ]; then
|
||||
echo "::error::Static Zlib missing!"
|
||||
exit 1
|
||||
fi
|
||||
# Fix ZSTD if missing
|
||||
if [ -z "$(find $LIB_DIR -name 'libzstd*.a')" ]; then
|
||||
echo "::error::Static Zstd missing!"
|
||||
exit 1
|
||||
echo "::warning::Static Zstd missing! Building locally..."
|
||||
curl -L -o zstd.tar.gz https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz
|
||||
tar -xf zstd.tar.gz && cd zstd-1.5.5
|
||||
make lib-release
|
||||
cp lib/libzstd.a $LIB_DIR/
|
||||
cp lib/zstd.h $INC_DIR/
|
||||
cd ..
|
||||
fi
|
||||
|
||||
# Fix ZLIB if missing
|
||||
if [ -z "$(find $LIB_DIR -name 'libz.a')" ]; then
|
||||
echo "::warning::Static Zlib missing! Building locally..."
|
||||
curl -L -o zlib.tar.gz https://zlib.net/zlib-1.3.1.tar.gz
|
||||
tar -xf zlib.tar.gz && cd zlib-1.3.1
|
||||
./configure --static
|
||||
make
|
||||
cp libz.a $LIB_DIR/
|
||||
cd ..
|
||||
fi
|
||||
|
||||
# Final Check
|
||||
if [ ! -f "$LIB_DIR/libzstd.a" ] || [ ! -f "$LIB_DIR/libz.a" ]; then
|
||||
echo "::error::Critical libraries still missing after fix attempt."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build Wownero Core
|
||||
@@ -188,29 +208,18 @@ jobs:
|
||||
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Package Artifacts (With Hunt & Copy)
|
||||
- name: Package Artifacts
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
mkdir -p output/lib output/include output/bin
|
||||
|
||||
find build/bin -type f -exec cp {} output/bin/ \;
|
||||
|
||||
# NUCLEAR LIBRARY COPY
|
||||
# Copy EVERYTHING in the lib folder
|
||||
cp -v $LIB_DIR/*.a output/lib/ || true
|
||||
|
||||
# Explicitly find and rename ZSTD/ZLIB if they have weird names
|
||||
# This ensures 'libzstd.a' and 'libz.a' exist in the output for LWS to find
|
||||
find $LIB_DIR -name "libzstd*.a" -exec cp -v {} output/lib/libzstd.a \;
|
||||
find $LIB_DIR -name "libz*.a" ! -name "*zmq*" -exec cp -v {} output/lib/libz.a \;
|
||||
|
||||
# Verify final payload
|
||||
echo "=== FINAL PAYLOAD ==="
|
||||
ls -l output/lib/
|
||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||
cp -v $LIB_DIR/*.a output/lib/
|
||||
|
||||
cp -r src output/include/wownero-src
|
||||
cp -r $INC_DIR/* output/include/
|
||||
|
||||
tar -czf wownero-core-${{ matrix.target }}.tar.gz -C output .
|
||||
|
||||
- name: Upload Artifact
|
||||
|
||||
Reference in New Issue
Block a user