Skip to content

Update cmake-multi-platform.yml #4

Update cmake-multi-platform.yml

Update cmake-multi-platform.yml #4

name: Build SDL2 Libraries
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: arm64
- os: windows-latest
arch: x86_64
- os: windows-latest
arch: x86
- os: windows-latest
arch: arm64
- os: macos-latest
arch: x86_64
- os: macos-latest
arch: arm64
steps:
- uses: actions/checkout@v2
with:
repository: 'libsdl-org/SDL'
ref: 'release-2.30.5'
path: 'SDL'
- name: Checkout specific commit
run: |
cd SDL
git checkout 2eef7ca
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libasound2-dev libpulse-dev libx11-dev cmake
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew update
brew install cmake
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Configure SDL2 with CMake for macOS ARM64
if: matrix.arch == 'arm64'
run: cmake -S SDL -B build/SDL -DCMAKE_OSX_ARCHITECTURES=arm64
- name: Configure SDL2 with CMake
if: matrix.arch == 'x86_64'
run: cmake -S SDL -B build/SDL
- name: Build SDL2
run: cmake --build build/SDL --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-artifacts
path: |
build/SDL/Release/*.dll
build/SDL/lib/*.so
build/SDL/lib/*.dylib
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'