forked from such-gitea/wownero-lws
add windows and linux and make release zips
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
name: Build Wowlet
|
name: Build Wownero LWS
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest # Runs on your Mac Mini
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Manual Checkout (Local)
|
- name: Manual Checkout (Local)
|
||||||
env:
|
env:
|
||||||
@@ -13,57 +13,127 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Cleaning workspace..."
|
echo "Cleaning workspace..."
|
||||||
rm -rf *
|
rm -rf *
|
||||||
|
|
||||||
# 1. (Optional) Safety config just in case
|
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
# 2. Clone using LOCALHOST (Port 3000)
|
# Clone from Localhost (Port 3000)
|
||||||
# We switch to HTTP to bypass SSL/Certificate errors entirely
|
|
||||||
echo "Cloning from Localhost..."
|
echo "Cloning from Localhost..."
|
||||||
git clone http://oauth2:$GITHUB_TOKEN@localhost:3000/${{ github.repository }}.git .
|
git clone http://oauth2:$GITHUB_TOKEN@localhost:3000/${{ github.repository }}.git .
|
||||||
|
|
||||||
# 3. Update Submodules
|
# Update Submodules
|
||||||
# We keep the forced HTTPS for submodules (since they live on GitHub/Codeberg)
|
|
||||||
# But we do NOT force it for the main repo anymore.
|
|
||||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||||
git config --global url."https://codeberg.org/".insteadOf "git@codeberg.org:"
|
git config --global url."https://codeberg.org/".insteadOf "git@codeberg.org:"
|
||||||
|
|
||||||
echo "Initializing submodules..."
|
echo "Initializing submodules..."
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
- name: Prepare Environment
|
- name: Prepare Environment
|
||||||
run: |
|
run: |
|
||||||
echo "Checking dependency versions..."
|
|
||||||
cmake --version
|
cmake --version
|
||||||
qmake --version || echo "QMake found via brew"
|
qmake --version || echo "QMake found via brew"
|
||||||
|
|
||||||
- name: Patch for macOS (Remove librt)
|
- name: Patch for macOS (Remove librt)
|
||||||
run: |
|
run: |
|
||||||
echo "Patching CMakeLists to remove Linux-only 'rt' library..."
|
echo "Patching CMakeLists..."
|
||||||
|
|
||||||
# 1. Use Perl to replace 'rt' with nothing, respecting word boundaries (\b).
|
|
||||||
# This catches " rt ", " rt)", " rt", etc., regardless of whitespace.
|
|
||||||
perl -i -pe 's/\brt\b//g' src/CMakeLists.txt
|
perl -i -pe 's/\brt\b//g' src/CMakeLists.txt
|
||||||
|
|
||||||
# 2. Just in case it's in the root file too (some forks do this)
|
|
||||||
if [ -f "CMakeLists.txt" ]; then
|
if [ -f "CMakeLists.txt" ]; then
|
||||||
perl -i -pe 's/\brt\b//g' CMakeLists.txt
|
perl -i -pe 's/\brt\b//g' CMakeLists.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3. Print the file to the log so we can verify the patch worked (Debugging)
|
|
||||||
echo "--- DEBUG: src/CMakeLists.txt content after patch ---"
|
|
||||||
grep -C 5 "target_link_libraries" src/CMakeLists.txt || true
|
|
||||||
|
|
||||||
- name: Build macOS
|
- name: Build macOS
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build && cd build
|
||||||
cd build
|
|
||||||
# Standard CMake build for Mac
|
|
||||||
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_BUILD_TYPE=Release
|
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_BUILD_TYPE=Release
|
||||||
make -j$(sysctl -n hw.ncpu)
|
make -j$(sysctl -n hw.ncpu)
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Package macOS
|
||||||
|
run: |
|
||||||
|
# Zip all 3 binaries into one file
|
||||||
|
cd build/src
|
||||||
|
zip ../../wownero-lws-macos.zip wownero-lws-daemon wownero-lws-admin wownero-lws-client
|
||||||
|
|
||||||
|
- name: Upload macOS Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: wowlet-macos
|
name: wownero-lws-macos
|
||||||
path: build/wowlet.app
|
path: wownero-lws-macos.zip
|
||||||
|
|
||||||
|
- name: Release macOS
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
files: wownero-lws-macos.zip
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Manual Checkout (LAN)
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
rm -rf *
|
||||||
|
# Clone from Mac's LAN IP
|
||||||
|
git clone http://oauth2:$GITHUB_TOKEN@192.168.88.230:3000/${{ github.repository }}.git .
|
||||||
|
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: Build Linux
|
||||||
|
run: |
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
- name: Package Linux
|
||||||
|
run: |
|
||||||
|
cd build/src
|
||||||
|
# Create a zip containing all 3 tools
|
||||||
|
zip ../../wownero-lws-linux.zip wownero-lws-daemon wownero-lws-admin wownero-lws-client
|
||||||
|
|
||||||
|
- name: Upload Linux Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: wownero-lws-linux
|
||||||
|
path: wownero-lws-linux.zip
|
||||||
|
|
||||||
|
- name: Release Linux
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
files: wownero-lws-linux.zip
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Manual Checkout (LAN)
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
rm -rf *
|
||||||
|
git clone http://oauth2:$GITHUB_TOKEN@192.168.88.230:3000/${{ github.repository }}.git .
|
||||||
|
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: Build Windows (Cross-Compile)
|
||||||
|
run: |
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake .. -DCMAKE_SYSTEM_NAME=Windows \
|
||||||
|
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
|
||||||
|
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
- name: Package Windows
|
||||||
|
run: |
|
||||||
|
cd build/src
|
||||||
|
# Zip the .exe files
|
||||||
|
zip ../../wownero-lws-windows.zip wownero-lws-daemon.exe wownero-lws-admin.exe wownero-lws-client.exe
|
||||||
|
|
||||||
|
- name: Upload Windows Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: wownero-lws-windows
|
||||||
|
path: wownero-lws-windows.zip
|
||||||
|
|
||||||
|
- name: Release Windows
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
files: wownero-lws-windows.zip
|
||||||
Reference in New Issue
Block a user