2024-04-16 18:09:30 +00:00
|
|
|
name: Descent 3 Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-04-17 19:01:20 +00:00
|
|
|
|
|
|
|
# In forks - all pushes and pull requests
|
|
|
|
# In main repo - only pushes and pull requests to the main branch
|
|
|
|
if: ( github.repository != 'kevinbentley/Descent3' )
|
|
|
|
|| ( github.repository == 'kevinbentley/Descent3'
|
|
|
|
&& ( github.ref == 'refs/heads/main'
|
|
|
|
|| github.event_name == 'pull_request' ) )
|
|
|
|
|
2024-04-16 18:09:30 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
matrix:
|
2024-04-17 18:46:40 +00:00
|
|
|
os:
|
|
|
|
- {runner: windows-latest, preset: win}
|
|
|
|
- {runner: macos-latest, preset: mac}
|
|
|
|
- {runner: ubuntu-latest, preset: linux}
|
2024-04-16 18:09:30 +00:00
|
|
|
build_type: [Debug, Release]
|
|
|
|
|
2024-04-17 02:08:32 +00:00
|
|
|
runs-on: ${{ matrix.os.runner }}
|
2024-04-16 18:09:30 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2024-04-17 02:12:59 +00:00
|
|
|
- name: Install macOS dependencies
|
|
|
|
if: ${{ matrix.os.preset == 'mac' }}
|
|
|
|
run: |
|
2024-04-17 15:10:36 +00:00
|
|
|
# Install packages from Homebrew
|
|
|
|
brew bundle install
|
2024-04-17 02:12:59 +00:00
|
|
|
|
2024-04-17 18:46:40 +00:00
|
|
|
- name: Install Linux dependencies
|
|
|
|
if: ${{ matrix.os.preset == 'linux' }}
|
|
|
|
run: |
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y --no-install-recommends \
|
|
|
|
make cmake g++ libsdl1.2-dev libsdl-image1.2-dev \
|
|
|
|
libaudio-dev libaa1-dev libdirectfb-dev \
|
|
|
|
libncurses-dev \
|
|
|
|
libxext6:i386 # for ./scripts/hogutils/hogUtils-i686 binary
|
2024-04-17 21:09:13 +00:00
|
|
|
mkdir ~/Descent3
|
2024-04-17 18:46:40 +00:00
|
|
|
|
2024-04-16 18:09:30 +00:00
|
|
|
- name: Configure CMake
|
2024-04-17 02:08:32 +00:00
|
|
|
run: cmake --preset ${{matrix.os.preset}} -B ${{github.workspace}}/build
|
2024-04-16 18:09:30 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
|
|
|
|
|
|
|
|
- name: 'Upload Artifacts'
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: build_${{matrix.build_type}}
|
|
|
|
path: ${{github.workspace}}/build/Descent3/${{matrix.build_type}}
|