Release 1.24.2
[openal-soft.git] / .github / workflows / utils.yml
blob4683a4e3244b7565ee376d20f72b914cbf8d48e8
1 name: utils
3 on:
4   push:
5     paths:
6       - 'utils/**'
7       - 'examples/**'
8       - '.github/workflows/utils.yml'
10   workflow_dispatch:
12 env:
13   BUILD_TYPE: Release
14   Branch: ${{github.ref_name}}
16 jobs:
17   Win64:
18     runs-on: windows-latest
20     steps:
21     - name: Clone repo and submodules
22       run: git clone https://github.com/${{github.repository}}.git . --branch ${{env.Branch}}
24     - name: Get current date, commit hash and count
25       run: |
26         echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV
27         echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
28         echo "CommitCount=$(git rev-list --count ${{env.Branch}} --)" >> $env:GITHUB_ENV
30     - name: Clone libmysofa
31       run: |
32         git clone https://github.com/hoene/libmysofa.git --branch v1.3.3
34     - name: Add MSBuild to PATH
35       uses: microsoft/setup-msbuild@v1.1.3
37     - name: Restore libmysofa NuGet packages
38       working-directory: ${{github.workspace}}/libmysofa
39       run: nuget restore ${{github.workspace}}/libmysofa/windows/libmysofa.sln
41     - name: Build libmysofa
42       working-directory: ${{github.workspace}}/libmysofa
43       run: msbuild /m /p:Configuration=${{env.BUILD_TYPE}} ${{github.workspace}}/libmysofa/windows/libmysofa.sln
45     - name: Configure CMake
46       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"
48     - name: Build
49       run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
51     - name: Make Artifacts folder
52       run: |
53         mkdir "Artifacts"
54         mkdir "Release"
56     - name: Collect artifacts
57       run: |
58         copy "build/Release/makemhr.exe" "Artifacts/makemhr.exe"
59         copy "build/Release/sofa-info.exe" "Artifacts/sofa-info.exe"
60         copy "build/Release/alrecord.exe" "Artifacts/alrecord.exe"
61         copy "build/Release/altonegen.exe" "Artifacts/altonegen.exe"
62         copy "build/Release/openal-info.exe" "Artifacts/openal-info.exe"
63         copy "build/Release/allafplay.exe" "Artifacts/allafplay.exe"
64         copy "libmysofa/windows/third-party/zlib-1.2.11/bin/zlib.dll" "Artifacts/zlib.dll"
66     - name: Upload artifacts
67       uses: actions/upload-artifact@v4
68       with:
69         name: ${{env.CommitDate}}_utils-r${{env.CommitCount}}@${{env.CommitHashShort}}
70         path: "Artifacts/"
72     - name: Compress artifacts
73       uses: papeloto/action-zip@v1
74       with:
75         files: Artifacts/
76         dest: "Release/utils.zip"
78     - name: GitHub pre-release
79       uses: "marvinpinto/action-automatic-releases@latest"
80       with:
81         repo_token: "${{secrets.GITHUB_TOKEN}}"
82         automatic_release_tag: "utils"
83         prerelease: true
84         title: "[${{env.CommitDate}}] utils-r${{env.CommitCount}}@${{env.CommitHashShort}}"
85         files: "Release/utils.zip"