64 lines
2.2 KiB
YAML
64 lines
2.2 KiB
YAML
name: Build
|
|
|
|
jobs:
|
|
# ===============================================================
|
|
# MACOS BUILD (Using Homebrew SDL3)
|
|
# ===============================================================
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
continue-on-error: true
|
|
steps:
|
|
# 1) Check out code
|
|
- name: Check Out Code
|
|
uses: actions/checkout@v3
|
|
|
|
# 2) Install dependencies (SDL3 via Homebrew) + ccache
|
|
- name: Install Dependencies (macOS)
|
|
run: |
|
|
brew update
|
|
brew install sdl3 meson ninja cmake ccache
|
|
|
|
# 3) Configure ccache
|
|
- name: Configure ccache
|
|
run: |
|
|
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
|
|
# 4) Cache ccache
|
|
- name: Cache ccache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/Library/Caches/ccache
|
|
key: ccache-macos-${{ hashFiles('**/*.c', '**/*.cpp', '**/*.h', '**/CMakeLists.txt', '**/meson.build') }}
|
|
restore-keys: |
|
|
ccache-macos-
|
|
|
|
# 5) Build Prosperon (macOS) linking against Homebrew's SDL3
|
|
- name: Build Prosperon (macOS)
|
|
run: |
|
|
# Ensure pkg-config can find Homebrew's SDL3 .pc files
|
|
export PKG_CONFIG_PATH="$(brew --prefix sdl3)/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
meson setup build_macos -Dbuildtype=release -Db_lto=true -Db_ndebug=true
|
|
meson compile -C build_macos
|
|
|
|
# 6) Copy SDL3 .dylib from Homebrew for packaging
|
|
- name: Copy SDL3 library for packaging
|
|
run: |
|
|
SDL3_PREFIX=$(brew --prefix sdl3)
|
|
mkdir -p sdl3-macos
|
|
# Copy all versions of the SDL3 dynamic library
|
|
cp -a "${SDL3_PREFIX}/lib/libSDL3*.dylib" sdl3-macos/ || echo "No .dylib found, ignoring"
|
|
|
|
# 7) Create minimal artifact folder (macOS)
|
|
- name: Create artifact folder (macOS)
|
|
run: |
|
|
mkdir _pack
|
|
cp build_macos/prosperon _pack/
|
|
cp sdl3-macos/libSDL3*.dylib _pack/ || echo "No .dylib found, ignoring"
|
|
|
|
# 8) Upload artifact (macOS)
|
|
- name: Upload Artifact (macOS)
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: prosperon-artifacts-macos
|
|
path: _pack |