diff --git a/.github/workflows/build-natives.yml b/.github/workflows/build-natives.yml index 3e950a6..41c5a4f 100644 --- a/.github/workflows/build-natives.yml +++ b/.github/workflows/build-natives.yml @@ -13,20 +13,33 @@ 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 @@ -34,6 +47,46 @@ jobs: 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 @@ -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 diff --git a/.github/workflows/build-nuget.yml b/.github/workflows/build-nuget.yml index 9d3cc35..58a23c7 100644 --- a/.github/workflows/build-nuget.yml +++ b/.github/workflows/build-nuget.yml @@ -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: diff --git a/OpenRA-OpenAL-CS.nuspec b/OpenRA-OpenAL-CS.nuspec index 30d2194..db2628c 100644 --- a/OpenRA-OpenAL-CS.nuspec +++ b/OpenRA-OpenAL-CS.nuspec @@ -26,8 +26,8 @@ - + diff --git a/OpenRA-OpenAL-CS.targets b/OpenRA-OpenAL-CS.targets index 5fc2bd7..33ae4bc 100644 --- a/OpenRA-OpenAL-CS.targets +++ b/OpenRA-OpenAL-CS.targets @@ -1,12 +1,12 @@ - + PreserveNewest soft_oal.dll false - + PreserveNewest soft_oal.dll false @@ -31,10 +31,5 @@ soft_oal.dylib false - - PreserveNewest - OpenAL-CS.dll.config - false -