Skip to content

Commit

Permalink
Add build/release system
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewham committed Jun 5, 2023
1 parent 131dc49 commit 1dcc044
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
79 changes: 79 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI
on: [push, pull_request]
permissions:
contents: write
jobs:
linux:
runs-on: ubuntu-latest

strategy:
matrix:
build: [Release]

steps:
- name: Clone
uses: actions/checkout@v1

- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake make
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
sudo apt-get install -y libenet-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y git
git submodule update --init
- name: Configure
run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} --target bomberbloke_client bomberbloke_server

- name: Build
run: make

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bomberbloke_server
bomberbloke_client
windows:
runs-on: ubuntu-latest

strategy:
matrix:
build: [Release]

steps:
- name: Clone
uses: actions/checkout@v1

- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake make
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
sudo apt-get install -y libenet-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y gcc-mingw-w64-base
sudo apt install -y g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix
sudo apt-get install -y git
git submodule update --init
- name: Configure
run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DCMAKE_SYSTEM_NAME=Generic -D_WIN32=TRUE -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc-posix -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++-posix -DCMAKE_RC_COMPILER="$(which x86_64-w64-mingw32-windres)" -DDLLTOOL="$(which x86_64-w64-mingw32-dlltool)" -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1

- name: Build
run: make

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bomberbloke_server.exe
bomberbloke_client.exe
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ find_program(CLANG_FORMAT "clang-format")
find_program(CLANG_TIDY "clang-tidy")

# Warning messages are treated as errors
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wpedantic -Wfatal-errors")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wpedantic -Wfatal-errors")

# Build docs
find_package(Doxygen)
Expand Down

0 comments on commit 1dcc044

Please sign in to comment.