Use ARM runner #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build native dependencies (OpenAL-Soft) | |
env: | |
OPENALSOFT_VERSION: 1.23.1 # Make sure this matches the version mentioned in the description in the .nuspec file. | |
on: | |
pull_request: | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
windows: | |
name: Windows (x86 + x64) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup Dependencies | |
run: | | |
mkdir -p artifacts/x86 | |
mkdir artifacts/x64 | |
# Download an official precompiled release version of OpenAL-Soft because compiling for Windows on Linux is hard. | |
- name: Download natives | |
run: | | |
curl -s -L -O https://openal-soft.org/openal-binaries/openal-soft-${OPENALSOFT_VERSION}-bin.zip | |
unzip -j -d artifacts/x86 openal-soft-${OPENALSOFT_VERSION}-bin.zip openal-soft-${OPENALSOFT_VERSION}-bin/bin/Win32/soft_oal.dll | |
unzip -j -d artifacts/x64 openal-soft-${OPENALSOFT_VERSION}-bin.zip openal-soft-${OPENALSOFT_VERSION}-bin/bin/Win64/soft_oal.dll | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Natives-Windows | |
path: ./artifacts | |
macos: | |
name: macOS (x64 + arm64) | |
runs-on: macos-13 | |
steps: | |
- name: Setup Dependencies | |
run: | | |
mkdir -p artifacts/x86_64 | |
mkdir artifacts/arm64 | |
- name: Compile natives | |
run: | | |
curl -s -L -O https://openal-soft.org/openal-releases/openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
tar xf openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
cd openal-soft-${OPENALSOFT_VERSION} | |
cmake -B build -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DALSOFT_EXAMPLES=OFF -DALSOFT_UTILS=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 | |
cmake --build build | |
lipo -thin x86_64 build/libopenal.${OPENALSOFT_VERSION}.dylib -output ../artifacts/x86_64/soft_oal.dylib | |
lipo -thin arm64 build/libopenal.${OPENALSOFT_VERSION}.dylib -output ../artifacts/arm64/soft_oal.dylib | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Natives-MacOS | |
path: ./artifacts | |
# Note: Running inside a CentOS container because we want to compile using a version of glibc | |
# that is as old as reasonably possible to ensure backwards compatibility of the compiled binaries. | |
linux-x64: | |
name: Linux (x64) | |
runs-on: ubuntu-22.04 | |
container: rockylinux:8 | |
steps: | |
- name: Setup Dependencies | |
run: | | |
mkdir -p artifacts/x64 | |
dnf -y install epel-release | |
yum -y install gcc-g++ gcc cmake bzip2 | |
yum -y install alsa-lib-devel portaudio-devel pulseaudio-libs-devel pipewire-devel | |
- name: Compile natives | |
run: | | |
curl -s -L -O https://openal-soft.org/openal-releases/openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
tar xf openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
cd openal-soft-${OPENALSOFT_VERSION}/build | |
cmake .. -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release | |
cmake --build . | |
cp libopenal.so ../../artifacts/x64/soft_oal.so | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Natives-Linux(x64) | |
path: ./artifacts | |
linux-arm64: | |
name: Linux (arm64) | |
runs-on: ubuntu-22.04-arm | |
steps: | |
- name: Setup Dependencies | |
run: | | |
mkdir -p artifacts/arm64 | |
sudo apt-get install -y build-essential curl cmake libasound2-dev portaudio19-dev libpulse-dev libpipewire-0.3-dev | |
- name: Compile Natives | |
run: | | |
curl -s -L -O https://openal-soft.org/openal-releases/openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
tar xf openal-soft-${OPENALSOFT_VERSION}.tar.bz2 | |
cd openal-soft-${OPENALSOFT_VERSION}/build | |
cmake .. -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release | |
cmake --build . | |
cp libopenal.so ../../artifacts/arm64/soft_oal.so | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Natives-Linux(arm64) | |
path: ./artifacts |