Easier building #189
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: CI | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
jobs: | |
build-Ubuntu: | |
name: "Build Appimage on Ubuntu" | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- run: sudo apt update | |
- name: Install meson | |
run: sudo apt install meson | |
- name: Install dependencies | |
run: sudo apt install libsfml-dev libboost-program-options-dev | |
- name: Configure the project with meson | |
run: meson build -Dprefix=$(pwd)/AppDir/usr | |
- name: Compile and install to AppDir | |
run: ninja -vC build install | |
- name: Download linuxdeploy | |
run: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage | |
- name: Add linuxdeploy dependency | |
run: sudo add-apt-repository universe; sudo apt install libfuse2 | |
- name: Create AppDir | |
run: ./linuxdeploy-x86_64.AppImage --appdir AppDir | |
- name: Create AppImage | |
run: ./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage | |
- name: Save AppImage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AppImage | |
path: Game_of_life* | |
build-Windows: | |
name: "Build on Windows" | |
runs-on: windows-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Cache Boost | |
uses: actions/cache@v2 | |
with: | |
path: '${{ runner.workspace }}/boost_*.tar.gz' | |
key: 'boost-1.78.0' | |
- name: Build Boost | |
id: boost | |
uses: egor-tensin/build-boost@v1 | |
with: | |
version: 1.78.0 | |
libraries: program_options | |
platform: x64 | |
configuration: Release | |
toolset: gcc | |
static: 1 | |
- name: Configure the project with cmake | |
run: | | |
cmake . -G "MinGW Makefiles" -D "BOOST_ROOT=${{ steps.boost.outputs.root }}" -D "BOOST_LIBRARYDIR=${{ steps.boost.outputs.librarydir }}" -D "BOOST_INCLUDEDIR=${{ steps.boost.outputs.root }}" | |
- name: Compile | |
run: mingw32-make | |
- name: Save executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows executable | |
path: game-of-life.exe |