forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (Final v3 Fix)
|
||||
name: Build Wownero Core (Windows Filename Fix)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
run: echo "192.168.88.230 git.such.software" >> /etc/hosts
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3 # Reverted to v3 for Gitea compatibility
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# 1. BUILD CONFIGURATION (Portable Mac Logic)
|
||||
# 1. BUILD CONFIGURATION
|
||||
# -----------------------------------------------------------------------
|
||||
- name: Sanitize Makefiles (Stable + Mac Compat)
|
||||
run: |
|
||||
@@ -117,6 +117,7 @@ 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
|
||||
@@ -124,11 +125,14 @@ 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
|
||||
@@ -176,17 +180,18 @@ jobs:
|
||||
make -j$(nproc)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# 3. FAIL-SAFE with ABSOLUTE PATHS (The Real Fix)
|
||||
# 2. FAIL-SAFE (Mkdir Fixed + Windows Name Fix)
|
||||
# -----------------------------------------------------------------------
|
||||
- name: Ensure Static Libs Exist
|
||||
run: |
|
||||
# Use $(pwd) to ensure these are ABSOLUTE PATHS
|
||||
# ABSOLUTE PATHS to prevent cp errors
|
||||
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"
|
||||
|
||||
mkdir -p $LIB_DIR
|
||||
mkdir -p $INC_DIR
|
||||
# Create dirs
|
||||
mkdir -p "$LIB_DIR"
|
||||
mkdir -p "$INC_DIR"
|
||||
|
||||
# 1. CHECK ZSTD
|
||||
if [ ! -f "$LIB_DIR/libzstd.a" ]; then
|
||||
@@ -202,8 +207,13 @@ jobs:
|
||||
-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_TESTS=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
# Copy using absolute path destination
|
||||
cp lib/libzstd.a "$LIB_DIR/"
|
||||
# Zstd naming is usually consistent, but let's be safe
|
||||
if [ -f lib/libzstd.a ]; then
|
||||
cp lib/libzstd.a "$LIB_DIR/"
|
||||
elif [ -f lib/libzstdstatic.a ]; then
|
||||
cp lib/libzstdstatic.a "$LIB_DIR/libzstd.a"
|
||||
fi
|
||||
|
||||
cp ../../lib/zstd.h "$INC_DIR/"
|
||||
cd ../../..
|
||||
fi
|
||||
@@ -221,8 +231,14 @@ jobs:
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
# Copy using absolute path destination
|
||||
cp libz.a "$LIB_DIR/"
|
||||
# WINDOWS FIX: Check for libzlibstatic.a
|
||||
if [ -f libz.a ]; then
|
||||
cp libz.a "$LIB_DIR/"
|
||||
elif [ -f libzlibstatic.a ]; then
|
||||
echo "Detected Windows naming (libzlibstatic.a). Renaming to libz.a..."
|
||||
cp libzlibstatic.a "$LIB_DIR/libz.a"
|
||||
fi
|
||||
|
||||
cp zlib.h "$INC_DIR/"
|
||||
cp zconf.h "$INC_DIR/"
|
||||
cd ../..
|
||||
@@ -237,6 +253,7 @@ 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
|
||||
@@ -247,7 +264,7 @@ jobs:
|
||||
tar -czf wownero-core-${{ matrix.target }}.tar.gz -C output .
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3 # Reverted to v3
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: wownero-core-${{ matrix.target }}
|
||||
path: wownero-core-${{ matrix.target }}.tar.gz
|
||||
@@ -258,7 +275,7 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v3 # Reverted to v3
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user