Skip to content

Update cmake-compile.yml #11

Update cmake-compile.yml

Update cmake-compile.yml #11

Workflow file for this run

name: CMake Compile
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
build_type: [Release, RelWithDebInfo]
steps:
- uses: actions/checkout@v4
- name: Install Clang (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y clang
- name: Configure CMake (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
export CC=clang
export CXX=clang++
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/Z7" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/Z7"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Upload Artifact (Windows - Release)
if: matrix.os == 'windows-latest' && matrix.build_type == 'Release'
uses: actions/upload-artifact@v4
with:
name: disableme_windows
path: ${{github.workspace}}/build/Release/endstone_disable_me.dll
- name: Upload Artifact (Windows - Debug)
if: matrix.os == 'windows-latest' && matrix.build_type == 'RelWithDebInfo'
uses: actions/upload-artifact@v4
with:
name: disableme_windows_debug
path: ${{github.workspace}}/build/RelWithDebInfo/endstone_disable_me.dll
- name: Upload Artifact (Linux - Release)
if: matrix.os == 'ubuntu-latest' && matrix.build_type == 'Release'
uses: actions/upload-artifact@v4
with:
name: disableme_linux
path: ${{github.workspace}}/build/endstone_disable_me.so
- name: Upload Artifact (Linux - Debug)
if: matrix.os == 'ubuntu-latest' && matrix.build_type == 'RelWithDebInfo'
uses: actions/upload-artifact@v4
with:
name: disableme_linux_debug
path: ${{github.workspace}}/build/endstone_disable_me.so