Skip to content

refactor: enhance code readability, structure, and maintainability #33

refactor: enhance code readability, structure, and maintainability

refactor: enhance code readability, structure, and maintainability #33

Workflow file for this run

name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest,windows-latest]
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: |
mkdir build
if [ ${{matrix.os}} == 'ubuntu-latest' ]; then
sudo apt-get update -y
sudo apt-get install -y \
libsfml-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libfreetype-dev \
libopenal-dev \
libflac-dev \
libvorbis-dev \
libgl1-mesa-dev \
libegl1-mesa-dev
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSNAKE_GENERATE_INSTALLER=TRUE
elif [ ${{matrix.os}} == 'windows-latest' ]; then
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSNAKE_GENERATE_INSTALLER=TRUE
fi
shell: bash
- name: Build Program
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build Installer
working-directory: ${{github.workspace}}/build
run: |
if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
sudo cpack -G "TGZ"
elif [ ${{ matrix.os }} == 'windows-latest' ]; then
choco install nsis
cpack -G "NSIS;ZIP"
fi
shell: bash