forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (v4 Actions + FailSafe)
|
||||
name: Build Wownero Core (Absolute Path Fix)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -29,14 +29,13 @@ jobs:
|
||||
run: echo "192.168.88.230 git.such.software" >> /etc/hosts
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4 # Upgraded to v4 to fix network 500s
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Manual config for gitea since checkout@v4 acts differently with self-hosted sometimes
|
||||
- name: Configure Git URLs
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
@@ -57,15 +56,13 @@ jobs:
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# 1. BUILD CONFIGURATION (Known Good Logic)
|
||||
# 1. BUILD CONFIGURATION (Portable Mac Logic)
|
||||
# -----------------------------------------------------------------------
|
||||
- name: Sanitize Makefiles (Stable + Mac Compat)
|
||||
run: |
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# GENERATE ZLIB.MK
|
||||
@@ -120,7 +117,6 @@ jobs:
|
||||
$(package)_config_opts_debug=variant=debug
|
||||
$(package)_config_opts+=--layout=system --user-config=user-config.jam
|
||||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
||||
|
||||
$(package)_config_opts_linux=threadapi=pthread runtime-link=static
|
||||
$(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
|
||||
@@ -128,14 +124,11 @@ jobs:
|
||||
$(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
|
||||
|
||||
$(package)_config_opts_aarch64_darwin=address-model=64 architecture=arm binary-format=mach-o abi=aapcs
|
||||
|
||||
$(package)_toolset_$(host_os)=gcc
|
||||
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||
$(package)_toolset_darwin=darwin
|
||||
$(package)_archiver_darwin=$($(package)_libtool)
|
||||
|
||||
$(package)_config_libraries=atomic,chrono,date_time,filesystem,program_options,regex,serialization,system,thread,locale,context,coroutine
|
||||
$(package)_cxxflags=-std=c++17 -fPIC
|
||||
endef
|
||||
@@ -183,15 +176,15 @@ jobs:
|
||||
make -j$(nproc)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# 2. FAIL-SAFE with MKDIR FIX (Fixes 'cp' crashes)
|
||||
# 3. FAIL-SAFE with ABSOLUTE PATHS (The Real Fix)
|
||||
# -----------------------------------------------------------------------
|
||||
- name: Ensure Static Libs Exist
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
# Use $(pwd) to ensure these are ABSOLUTE PATHS
|
||||
LIB_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/include"
|
||||
TOOLCHAIN="$(pwd)/contrib/depends/${{ matrix.target }}/share/toolchain.cmake"
|
||||
|
||||
# FIX: Create directories so 'cp' doesn't fail
|
||||
mkdir -p $LIB_DIR
|
||||
mkdir -p $INC_DIR
|
||||
|
||||
@@ -208,8 +201,10 @@ jobs:
|
||||
-DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_SHARED=OFF \
|
||||
-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_TESTS=OFF
|
||||
make -j$(nproc)
|
||||
cp lib/libzstd.a $LIB_DIR/
|
||||
cp ../../lib/zstd.h $INC_DIR/
|
||||
|
||||
# Copy using absolute path destination
|
||||
cp lib/libzstd.a "$LIB_DIR/"
|
||||
cp ../../lib/zstd.h "$INC_DIR/"
|
||||
cd ../../..
|
||||
fi
|
||||
|
||||
@@ -225,9 +220,11 @@ jobs:
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
make -j$(nproc)
|
||||
cp libz.a $LIB_DIR/
|
||||
cp zlib.h $INC_DIR/
|
||||
cp zconf.h $INC_DIR/
|
||||
|
||||
# Copy using absolute path destination
|
||||
cp libz.a "$LIB_DIR/"
|
||||
cp zlib.h "$INC_DIR/"
|
||||
cp zconf.h "$INC_DIR/"
|
||||
cd ../..
|
||||
fi
|
||||
|
||||
@@ -240,7 +237,6 @@ jobs:
|
||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||
cp -v $LIB_DIR/*.a output/lib/
|
||||
|
||||
# Final Verification
|
||||
ls -l output/lib/libz*.a
|
||||
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
|
||||
@@ -251,7 +247,7 @@ jobs:
|
||||
tar -czf wownero-core-${{ matrix.target }}.tar.gz -C output .
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4 # Upgraded to v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wownero-core-${{ matrix.target }}
|
||||
path: wownero-core-${{ matrix.target }}.tar.gz
|
||||
@@ -262,7 +258,7 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4 # Upgraded to v4
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user