aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
author3DJ <[email protected]>2022-11-17 02:13:18 -0500
committerGitHub <[email protected]>2022-11-16 23:13:18 -0800
commit6dad96d8d3ddb34a16a1b5c71537aea74f53b7f9 (patch)
treee9f18e62412bdff3892289a836b26b319eb06853 /.github
parent3cb6d30e4dfed2acc22a8b12c11b01a8baae4c46 (diff)
Add GitHub actions workflow to build utils/makemhr on update (#783)
* Build utils/makemhr on update This workflow builds makemhr.exe including dependencies (libmysofa, zlib, etc) whenever anything under utils/makemhr or the workflow is updated. It also uploads artifacts and [(pre)releases it with its own tag](https://github.com/ThreeDeeJay/openal-soft/releases/tag/makemhr) for a [permanent, up-to-date download link](https://github.com/ThreeDeeJay/openal-soft/releases/download/makemhr/makemhr.zip). * Clone latest libmysofa release tag without history
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/makemhr.yml76
1 files changed, 76 insertions, 0 deletions
diff --git a/.github/workflows/makemhr.yml b/.github/workflows/makemhr.yml
new file mode 100644
index 00000000..7bde284c
--- /dev/null
+++ b/.github/workflows/makemhr.yml
@@ -0,0 +1,76 @@
+name: makemhr
+
+on:
+ push:
+ paths:
+ - 'utils/makemhr/**'
+ - '.github/workflows/makemhr.yml'
+
+ workflow_dispatch:
+
+env:
+ BUILD_TYPE: Release
+
+jobs:
+ Win64:
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Get current date
+ run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
+
+ - name: Get commit hash
+ run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
+
+ - name: Clone libmysofa
+ run: git clone --depth 1 --branch v1.3.1 https://github.com/hoene/libmysofa.git libmysofa
+
+ - name: Add MSBuild to PATH
+ uses: microsoft/[email protected]
+
+ - name: Restore libmysofa NuGet packages
+ working-directory: ${{github.workspace}}/libmysofa
+ run: nuget restore ${{github.workspace}}/libmysofa/windows/libmysofa.sln
+
+ - name: Build libmysofa
+ working-directory: ${{github.workspace}}/libmysofa
+ run: msbuild /m /p:Configuration=${{env.BUILD_TYPE}} ${{github.workspace}}/libmysofa/windows/libmysofa.sln
+
+ - name: Configure CMake
+ run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -D "MYSOFA_LIBRARY=${{github.workspace}}/libmysofa/windows/bin/x64/Release/mysofa.lib" -D "MYSOFA_INCLUDE_DIR=${{github.workspace}}/libmysofa/src/hrtf" -D "ZLIB_LIBRARY=${{github.workspace}}/libmysofa/windows/third-party/zlib-1.2.11/lib/zlib.lib" -D "ZLIB_INCLUDE_DIR=${{github.workspace}}/libmysofa/windows/third-party/zlib-1.2.11/include"
+
+ - name: Build
+ run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
+
+ - name: Make Artifacts folder
+ run: |
+ mkdir "Artifacts"
+ mkdir "Release"
+
+ - name: Collect artifacts
+ run: |
+ copy "build/Release/makemhr.exe" "Artifacts/makemhr.exe"
+ copy "libmysofa/windows/third-party/zlib-1.2.11/bin/zlib.dll" "Artifacts/zlib.dll"
+
+ - name: Upload makemhr artifact
+ uses: actions/[email protected]
+ with:
+ name: makemhr
+ path: "Artifacts/"
+
+ - name: Compress artifacts
+ uses: papeloto/action-zip@v1
+ with:
+ files: Artifacts/
+ dest: "Release/makemhr.zip"
+
+ - name: GitHub pre-release
+ uses: "marvinpinto/action-automatic-releases@latest"
+ with:
+ repo_token: "${{secrets.GITHUB_TOKEN}}"
+ automatic_release_tag: "makemhr"
+ prerelease: true
+ title: "[${{env.CurrentDate}}] makemhr-${{env.CommitHash}}"
+ files: "Release/makemhr.zip"