Updated .github/workflows/cmake.yml #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: [push] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: RelWithDebInfo | |
XB2C_VERSION: 1.5.1 | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-11 | |
# - macos-latest | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Windows: Configure environment" | |
if: runner.os == 'Windows' | |
shell: bash | |
run: | | |
# Select MinGW toolchain instead of the default MSVC. | |
echo "CMAKE_GENERATOR=MinGW Makefiles" >> $GITHUB_ENV | |
- name: "Linux: Install dependency libraries" | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends freeglut3-dev libudev-dev libopenal-dev | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/src | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
working-directory: ${{github.workspace}}/src | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: binaries-${{matrix.os}} | |
path: ${{github.workspace}}/build/*.xpl | |
if-no-files-found: error | |
package: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/upload-artifact/merge@v4 | |
with: | |
name: binaries | |
pattern: binaries-* | |
- uses: actions/download-artifact@v4 | |
with: | |
name: binaries | |
path: Xbtn2cmd/lin_x64 | |
- name: Test artifact download | |
run: ls -R -l | |
- name: Rename lin.xpl to Xbtn2cmd.xpl | |
run: mv Xbtn2cmd/lin_x64/lin.xpl Xbtn2cmd/lin_x64/Xbtn2cmd.xpl | |
- name: List folder | |
run: ls -R -l | |
- name: Rename win.xpl to Xbtn2cmd/win_x64/Xbtn2cmd.xpl | |
run: mv Xbtn2cmd/lin_x64/win.xpl Xbtn2cmd/win_x64/Xbtn2cmd.xpl | |
- name: Rename mac.xpl to Xbtn2cmd/mac_x64/Xbtn2cmd.xpl | |
run: mv Xbtn2cmd/lin_x64/mac.xpl Xbtn2cmd/mac_x64/Xbtn2cmd.xpl | |
- name: List Final Folder | |
run: ls -R -l | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Xbtn2cmd_v${{env.XB2C_VERSION}} | |
path: | | |
${{github.workspace}}/Xbtn2cmd* | |
if-no-files-found: error |