]> git.tdb.fi Git - ext/openal.git/blob - .github/workflows/makemhr.yml
Import OpenAL Soft 1.23.1 sources
[ext/openal.git] / .github / workflows / makemhr.yml
1 name: makemhr
2
3 on:
4   push:
5     paths:
6       - 'utils/makemhr/**'
7       - '.github/workflows/makemhr.yml'
8
9   workflow_dispatch:
10
11 env:
12   BUILD_TYPE: Release
13
14 jobs:
15   Win64:
16     runs-on: windows-latest
17
18     steps:
19     - uses: actions/checkout@v3
20
21     - name: Get current date
22       run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
23
24     - name: Get commit hash
25       run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
26
27     - name: Clone libmysofa
28       run: git clone --depth 1 --branch v1.3.1 https://github.com/hoene/libmysofa.git libmysofa
29
30     - name: Add MSBuild to PATH
31       uses: microsoft/setup-msbuild@v1.1.3
32
33     - name: Restore libmysofa NuGet packages
34       working-directory: ${{github.workspace}}/libmysofa
35       run: nuget restore ${{github.workspace}}/libmysofa/windows/libmysofa.sln
36
37     - name: Build libmysofa
38       working-directory: ${{github.workspace}}/libmysofa
39       run: msbuild /m /p:Configuration=${{env.BUILD_TYPE}} ${{github.workspace}}/libmysofa/windows/libmysofa.sln
40
41     - name: Configure CMake
42       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"
43
44     - name: Build
45       run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
46
47     - name: Make Artifacts folder
48       run: |
49         mkdir "Artifacts"
50         mkdir "Release"
51
52     - name: Collect artifacts
53       run: |
54         copy "build/Release/makemhr.exe" "Artifacts/makemhr.exe"
55         copy "libmysofa/windows/third-party/zlib-1.2.11/bin/zlib.dll" "Artifacts/zlib.dll"
56
57     - name: Upload makemhr artifact
58       uses: actions/upload-artifact@v3.1.1
59       with:
60         name: makemhr
61         path: "Artifacts/"
62
63     - name: Compress artifacts
64       uses: papeloto/action-zip@v1
65       with:
66         files: Artifacts/
67         dest: "Release/makemhr.zip"
68
69     - name: GitHub pre-release
70       uses: "marvinpinto/action-automatic-releases@latest"
71       with:
72         repo_token: "${{secrets.GITHUB_TOKEN}}"
73         automatic_release_tag: "makemhr"
74         prerelease: true
75         title: "[${{env.CurrentDate}}] makemhr-${{env.CommitHash}}"
76         files: "Release/makemhr.zip"