forked from such-gitea/wownero-lws
144 lines
4.7 KiB
YAML
144 lines
4.7 KiB
YAML
name: Build Wownero LWS
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Manual Checkout (Local)
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
echo "Cleaning workspace..."
|
|
rm -rf *
|
|
git config --global --add safe.directory '*'
|
|
|
|
# Clone from Localhost (Port 3000)
|
|
echo "Cloning from Localhost..."
|
|
git clone http://oauth2:$GITHUB_TOKEN@localhost:3000/${{ github.repository }}.git .
|
|
|
|
# Update Submodules
|
|
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
git config --global url."https://codeberg.org/".insteadOf "git@codeberg.org:"
|
|
echo "Initializing submodules..."
|
|
git submodule update --init --recursive
|
|
|
|
- name: Prepare Environment
|
|
run: |
|
|
cmake --version
|
|
qmake --version || echo "QMake found via brew"
|
|
|
|
- name: Patch for macOS (Remove librt)
|
|
run: |
|
|
echo "Patching CMakeLists..."
|
|
perl -i -pe 's/\brt\b//g' src/CMakeLists.txt
|
|
if [ -f "CMakeLists.txt" ]; then
|
|
perl -i -pe 's/\brt\b//g' CMakeLists.txt
|
|
fi
|
|
|
|
- name: Build macOS
|
|
run: |
|
|
mkdir build && cd build
|
|
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_BUILD_TYPE=Release
|
|
make -j$(sysctl -n hw.ncpu)
|
|
|
|
- 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
|
|
with:
|
|
name: wownero-lws-macos
|
|
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 # Maps to 'linux-beast'
|
|
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 Dependencies
|
|
run: |
|
|
# FIX: The depends folder is inside the submodule!
|
|
cd external/monero/contrib/depends
|
|
make HOST=x86_64-w64-mingw32 -j$(nproc)
|
|
|
|
- name: Build Windows (Cross-Compile)
|
|
run: |
|
|
mkdir build && cd build
|
|
# We use the toolchain file generated by the previous step
|
|
# This tells CMake exactly where the Windows OpenSSL/Boost libraries are
|
|
cmake .. -DCMAKE_TOOLCHAIN_FILE=../contrib/depends/x86_64-w64-mingw32/share/toolchain.cmake -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 |