Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 64 additions & 9 deletions .github/workflows/build-natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,80 @@ permissions:

jobs:
windows:
name: Windows (x86 + x64)
runs-on: ubuntu-22.04
name: Windows (x64)
runs-on: windows-2022
steps:
- name: Setup Dependencies
shell: pwsh
run: |
New-Item -ItemType Directory -Force artifacts/x64 | Out-Null

- name: Download sources
shell: pwsh
run: |
mkdir -p artifacts/x86
mkdir artifacts/x64
$version = ${env:OPENALSOFT_VERSION}
$archive = "openal-soft-$version.tar.bz2"
$url = "https://openal-soft.org/openal-releases/$archive"

# Download an official precompiled release version of OpenAL-Soft because compiling for Windows on Linux is hard.
- name: Download natives
Invoke-WebRequest -Uri $url -OutFile $archive

$sevenZip = "${env:ProgramFiles}\7-Zip\7z.exe"
& $sevenZip x $archive -y
& $sevenZip x "openal-soft-$version.tar" -y

- name: Build x64
shell: pwsh
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
cmake -S "openal-soft-${env:OPENALSOFT_VERSION}" -B build-x64 -A x64 -DALSOFT_EXAMPLES=OFF -DALSOFT_UTILS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-x64 --config Release
Copy-Item "build-x64\Release\OpenAL32.dll" "artifacts\x64\soft_oal.dll"

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Natives-Windows
path: ./artifacts

windows-arm64:
name: Windows (arm64)
runs-on: windows-11-arm
steps:
- name: Setup Dependencies
shell: pwsh
run: |
New-Item -ItemType Directory -Force artifacts/arm64 | Out-Null

- name: Download sources
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"

$version = ${env:OPENALSOFT_VERSION}
$archive = "openal-soft-$version.tar.bz2"
$url = "https://openal-soft.org/openal-releases/$archive"

Invoke-WebRequest -Uri $url -OutFile $archive

$sevenZip = "${env:ProgramFiles}\7-Zip\7z.exe"
& $sevenZip x $archive -y
& $sevenZip x "openal-soft-$version.tar" -y

- name: Build arm64
shell: pwsh
run: |
cmake -S "openal-soft-$env:OPENALSOFT_VERSION" -B build-arm64 -G "Visual Studio 17 2022" -A ARM64 `
-DALSOFT_EXAMPLES=OFF -DALSOFT_UTILS=OFF -DBUILD_SHARED_LIBS=ON `
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
cmake --build build-arm64 --config Release
Copy-Item "build-arm64\Release\OpenAL32.dll" "artifacts\arm64\soft_oal.dll"

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Natives-Windows(arm64)
path: ./artifacts

macos:
name: macOS (x64 + arm64)
runs-on: macos-14
Expand Down Expand Up @@ -95,7 +148,9 @@ jobs:
- name: Setup Dependencies
run: |
mkdir -p artifacts/arm64
sudo apt-get update
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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
name: Natives-Windows
path: ./native/win

- name: Download artifacts - native - Windows (arm64)
uses: actions/download-artifact@v4
with:
name: Natives-Windows(arm64)
path: ./native/win

- name: Download artifacts - native - MacOS
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion OpenRA-OpenAL-CS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<files>
<file src="OpenRA-OpenAL-CS.targets" target="build" />
<file src="bin/netstandard2.0/OpenAL-CS.*" target="lib/netstandard2.0" />
<file src="native/win/x86/soft_oal.dll" target="native/win-x86" />
<file src="native/win/x64/soft_oal.dll" target="native/win-x64" />
<file src="native/win/arm64/soft_oal.dll" target="native/win-arm64" />
<file src="native/linux/x64/soft_oal.so" target="native/linux-x64" />
<file src="native/linux/arm64/soft_oal.so" target="native/linux-arm64" />
<file src="native/osx/x86_64/soft_oal.dylib" target="native/osx-x64" />
Expand Down
9 changes: 2 additions & 7 deletions OpenRA-OpenAL-CS.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x86\soft_oal.dll" Condition="'$(TargetPlatform)' == 'win-x86'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\soft_oal.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>soft_oal.dll</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\soft_oal.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-arm64\soft_oal.dll" Condition="'$(TargetPlatform)' == 'win-arm64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>soft_oal.dll</Link>
<Visible>false</Visible>
Expand All @@ -31,10 +31,5 @@
<Link>soft_oal.dylib</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\lib\netstandard2.0\OpenAL-CS.dll.config" Condition="'$(TargetPlatform)' != 'win-x64' And '$(TargetPlatform)' != 'win-x86'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>OpenAL-CS.dll.config</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
</Project>
Loading