3 on: [push, pull_request]
7 name: ${{matrix.config.name}}
8 runs-on: ${{matrix.config.os}}
14 name: "Win32-Release",
16 cmake_opts: "-A Win32 \
18 -DALSOFT_BUILD_ROUTER=ON \
19 -DALSOFT_REQUIRE_WINMM=ON \
20 -DALSOFT_REQUIRE_DSOUND=ON \
21 -DALSOFT_REQUIRE_WASAPI=ON",
27 cmake_opts: "-A Win32 \
29 -DALSOFT_BUILD_ROUTER=ON \
30 -DALSOFT_REQUIRE_WINMM=ON \
31 -DALSOFT_REQUIRE_DSOUND=ON \
32 -DALSOFT_REQUIRE_WASAPI=ON",
36 name: "Win64-Release",
40 -DALSOFT_BUILD_ROUTER=ON \
41 -DALSOFT_REQUIRE_WINMM=ON \
42 -DALSOFT_REQUIRE_DSOUND=ON \
43 -DALSOFT_REQUIRE_WASAPI=ON",
51 -DALSOFT_BUILD_ROUTER=ON \
52 -DALSOFT_REQUIRE_WINMM=ON \
53 -DALSOFT_REQUIRE_DSOUND=ON \
54 -DALSOFT_REQUIRE_WASAPI=ON",
62 -DCMAKE_SYSTEM_NAME=WindowsStore \
63 \"-DCMAKE_SYSTEM_VERSION=10.0\" \
64 -DALSOFT_BUILD_ROUTER=ON \
65 -DALSOFT_REQUIRE_WASAPI=ON",
69 name: "macOS-Release",
71 cmake_opts: "-DALSOFT_REQUIRE_COREAUDIO=ON \
78 cmake_opts: "-GXcode \
79 -DCMAKE_SYSTEM_NAME=iOS \
80 -DALSOFT_REQUIRE_COREAUDIO=ON \
82 -DALSOFT_EXAMPLES=OFF \
84 -DALSOFT_INSTALL=OFF \
85 \"-DCMAKE_OSX_ARCHITECTURES=arm64\"",
89 name: "Linux-Release",
91 cmake_opts: "-DALSOFT_REQUIRE_RTKIT=ON \
92 -DALSOFT_REQUIRE_ALSA=ON \
93 -DALSOFT_REQUIRE_OSS=ON \
94 -DALSOFT_REQUIRE_PORTAUDIO=ON \
95 -DALSOFT_REQUIRE_PULSEAUDIO=ON \
96 -DALSOFT_REQUIRE_JACK=ON \
97 -DALSOFT_REQUIRE_PIPEWIRE=ON \
99 deps_cmdline: "sudo apt update && sudo apt-get install -qq \
104 libpipewire-0.3-dev \
107 build_type: "Release"
110 name: "Android_armeabi-v7a-Release",
112 cmake_opts: "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
113 -DALSOFT_EMBED_HRTF_DATA=TRUE \
114 -DALSOFT_REQUIRE_OPENSL=ON",
115 build_type: "Release"
118 name: "Android_arm64-v8a-Release",
120 cmake_opts: "-DANDRIOD_ABI=arm64-v8a \
121 -DANDROID_PLATFORM=25 \
122 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
123 -DALSOFT_EMBED_HRTF_DATA=TRUE \
124 -DALSOFT_REQUIRE_OPENSL=ON",
125 build_type: "Release"
128 - uses: actions/checkout@v4
132 - name: Get current commit tag, short hash, count and date
134 echo "CommitTag=$(git describe --tags --abbrev=0 --match *.*.*)" >> $env:GITHUB_ENV
135 echo "CommitHashShort=$(git rev-parse --short=8 HEAD)" >> $env:GITHUB_ENV
136 echo "CommitCount=$(git rev-list --count $env:GITHUB_REF_NAME)" >> $env:GITHUB_ENV
137 echo "CommitDate=$(git show -s --date=iso-local --format=%cd)" >> $env:GITHUB_ENV
139 - name: Install Dependencies
142 if [[ ! -z "${{matrix.config.deps_cmdline}}" ]]; then
143 eval ${{matrix.config.deps_cmdline}}
149 cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_opts}} .
154 cmake --build build --config ${{matrix.config.build_type}}
162 - name: Set up Windows artifacts
163 if: ${{ contains(matrix.config.name, 'Win') }}
169 cp ${{matrix.config.build_type}}/soft_oal.dll archive
170 cp ${{matrix.config.build_type}}/OpenAL32.dll archive/router
172 - name: Set up Android artifacts
173 if: ${{ contains(matrix.config.name, 'Android') }}
178 cp ${{github.workspace}}/build/libopenal.so archive/
180 - name: Upload build as a workflow artifact
181 uses: actions/upload-artifact@v4
182 if: ${{ contains(matrix.config.name, 'Win') || contains(matrix.config.name, 'Android') }}
184 name: soft_oal-${{matrix.config.name}}
188 CommitTag: ${{env.CommitTag}}
189 CommitHashShort: ${{env.CommitHashShort}}
190 CommitCount: ${{env.CommitCount}}
191 CommitDate: ${{env.CommitDate}}
194 if: github.event_name != 'pull_request'
196 runs-on: ubuntu-latest
199 - name: Download build artifacts
200 uses: actions/download-artifact@v4.1.7
203 pattern: "*-Win??-Release"
204 github-token: "${{secrets.GITHUB_TOKEN}}"
206 - name: Set up build folders
208 mkdir -p build/release/OpenALSoft/Documentation
209 mkdir -p build/release/OpenALSoft/Win32
210 mkdir -p build/release/OpenALSoft/Win64
211 echo "${{github.repository}}" >> "build/release/OpenALSoft/Documentation/Version.txt"
212 echo "v${{needs.build.outputs.CommitTag}}-${{needs.build.outputs.CommitHashShort}} ${{github.ref_name}}" >> "build/release/OpenALSoft/Documentation/Version.txt"
213 echo "Commit #${{needs.build.outputs.CommitCount}}" >> "build/release/OpenALSoft/Documentation/Version.txt"
214 echo "${{needs.build.outputs.CommitDate}}" >> "build/release/OpenALSoft/Documentation/Version.txt"
215 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/README.md -o "build/release/OpenALSoft/Documentation/ReadMe.txt"
216 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/ChangeLog -o "build/release/OpenALSoft/Documentation/ChangeLog.txt"
217 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/COPYING -o "build/release/OpenALSoft/Documentation/License.txt"
218 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/BSD-3Clause -o "build/release/OpenALSoft/Documentation/License_BSD-3Clause.txt"
219 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/alsoftrc.sample -o "build/release/OpenALSoft/Win32/alsoft.ini"
220 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/alsoftrc.sample -o "build/release/OpenALSoft/Win64/alsoft.ini"
221 cp "build/soft_oal-Win32-Release/soft_oal.dll" "build/release/OpenALSoft/Win32/OpenAL32.dll"
222 cp "build/soft_oal-Win64-Release/soft_oal.dll" "build/release/OpenALSoft/Win64/OpenAL32.dll"
223 cp -r "build/release/OpenALSoft" "build/release/OpenALSoft+HRTF"
224 cp "build/release/OpenALSoft+HRTF/Win32/alsoft.ini" "build/release/OpenALSoft+HRTF/Documentation/alsoft.ini"
225 curl https://raw.githubusercontent.com/${{github.repository}}/${{github.ref_name}}/configs/HRTF/alsoft.ini -o "build/release/OpenALSoft+HRTF/Win32/alsoft.ini"
226 cp "build/release/OpenALSoft+HRTF/Win32/alsoft.ini" "build/release/OpenALSoft+HRTF/Win64/alsoft.ini"
228 - name: Compress artifacts
231 7z a OpenALSoft.zip ./OpenALSoft/*
232 7z a OpenALSoft+HRTF.zip ./OpenALSoft+HRTF/*
234 - name: GitHub pre-release
235 uses: "Sweeistaken/sweelease@v1.1"
237 repo_token: "${{secrets.GITHUB_TOKEN}}"
238 automatic_release_tag: "latest"
240 title: "OpenAL Soft v${{needs.build.outputs.CommitTag}}-${{needs.build.outputs.CommitHashShort}}"
241 files: "build/release/*"