njohnson 9a8170f1d8
Some checks failed
CI Build / build-ubuntu (push) Failing after 5s
CI Build / build-macos (push) Successful in 26s
CI Build / build-windows (push) Successful in 8m49s
Fix Ubuntu CI: handle root/container environments without sudo
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:23:44 -05:00

147 lines
3.8 KiB
YAML

name: CI Build
on:
push:
branches:
- '**'
pull_request:
jobs:
build-windows:
runs-on: windows
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build
shell: cmd
run: |
set PATH=C:\Qt\6.10.1\msvc2022_64\bin;C:\Qt\Tools\QtCreator\bin\jom;%PATH%
if not exist build mkdir build
cd build
echo === Running qmake ===
qmake.exe ..\XPlor.pro -spec win32-msvc "CONFIG+=release"
if errorlevel 1 exit /b 1
echo === Building with jom ===
jom.exe -j 1
if errorlevel 1 exit /b 1
echo === Build successful ===
- name: Deploy Qt
shell: cmd
run: |
set PATH=C:\Qt\6.10.1\msvc2022_64\bin;%PATH%
cd build\app\release
windeployqt6.exe --release --no-translations app.exe
if errorlevel 1 exit /b 1
echo === windeployqt successful ===
build-macos:
runs-on: macos
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
shell: bash
run: |
# Try multiple Qt locations
for QT_PATH in ~/Qt/6.10.1/macos ~/Qt/6.9.0/macos ~/Qt/6.8.0/macos /opt/homebrew/opt/qt@6; do
if [ -f "$QT_PATH/bin/qmake" ]; then
echo "Found Qt at: $QT_PATH"
export PATH="$QT_PATH/bin:$PATH"
break
fi
done
# Verify qmake exists
which qmake || { echo "ERROR: qmake not found"; exit 1; }
mkdir -p build
cd build
echo "=== Running qmake ==="
qmake ../XPlor.pro -spec macx-clang "CONFIG+=release"
echo "=== Building with make ==="
make -j$(sysctl -n hw.ncpu)
echo "=== Build successful ==="
- name: Deploy Qt
shell: bash
run: |
# Find Qt again for this step
for QT_PATH in ~/Qt/6.10.1/macos ~/Qt/6.9.0/macos ~/Qt/6.8.0/macos /opt/homebrew/opt/qt@6; do
if [ -f "$QT_PATH/bin/macdeployqt" ]; then
export PATH="$QT_PATH/bin:$PATH"
break
fi
done
cd build/app
if [ -d "XPlor.app" ]; then
macdeployqt XPlor.app -verbose=1
fi
echo "=== macdeployqt complete ==="
build-ubuntu:
runs-on: ubuntu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
shell: bash
run: |
# Use sudo if available, otherwise run directly (for root/container environments)
if command -v sudo &> /dev/null; then
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev zlib1g-dev
else
apt-get update
apt-get install -y build-essential libgl1-mesa-dev zlib1g-dev
fi
- name: Build
shell: bash
run: |
# Try multiple Qt locations
for QT_PATH in ~/Qt/6.10.1/gcc_64 ~/Qt/6.9.0/gcc_64 ~/Qt/6.8.0/gcc_64 /opt/Qt/6.10.1/gcc_64 /usr/lib/qt6; do
if [ -f "$QT_PATH/bin/qmake" ]; then
echo "Found Qt at: $QT_PATH"
export PATH="$QT_PATH/bin:$PATH"
export LD_LIBRARY_PATH="$QT_PATH/lib:$LD_LIBRARY_PATH"
break
fi
done
# Verify qmake exists
which qmake || { echo "ERROR: qmake not found"; exit 1; }
mkdir -p build
cd build
echo "=== Running qmake ==="
qmake ../XPlor.pro -spec linux-g++ "CONFIG+=release"
echo "=== Building with make ==="
make -j$(nproc)
echo "=== Build successful ==="