2021-06-17 01:59:39 +02:00
|
|
|
name: CMake
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ develop ]
|
|
|
|
|
|
|
|
jobs:
|
2021-06-20 03:03:46 +02:00
|
|
|
build-linux:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, ubuntu-latest]
|
|
|
|
compiler: [gcc, clang]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Get dependencies
|
|
|
|
run: sudo mk/linux/setupBuildDeps.sh
|
|
|
|
|
2021-06-20 03:11:38 +02:00
|
|
|
- name: Bulid MegaGlest With GCC Compiler
|
2021-06-20 03:15:55 +02:00
|
|
|
if: ${{ matrix.compiler == 'gcc' }}
|
2021-06-20 03:03:46 +02:00
|
|
|
env:
|
|
|
|
CC: gcc
|
|
|
|
CXX: g++
|
2021-06-20 03:11:38 +02:00
|
|
|
run: mk/linux/build-mg.sh
|
|
|
|
|
|
|
|
- name: Bulid MegaGlest With Clang Compiler
|
2021-06-20 03:14:04 +02:00
|
|
|
if: ${{ matrix.compiler == 'clang' }}
|
2021-06-20 03:03:46 +02:00
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
CXX: clang++
|
|
|
|
run: mk/linux/build-mg.sh
|
2021-06-20 03:11:38 +02:00
|
|
|
|
2021-06-20 03:03:46 +02:00
|
|
|
- name: Get Additional Dependencies
|
|
|
|
run: cp mk/shared/*.ini mk/linux/
|
|
|
|
|
|
|
|
- name: Create Mega Glest Snapshot
|
2021-06-20 03:14:04 +02:00
|
|
|
if: ${{ matrix.compiler == 'gcc' }}
|
2021-06-20 03:03:46 +02:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: megaglest-x64-snapshot
|
|
|
|
path: |
|
|
|
|
mk/linux/megaglest
|
|
|
|
mk/linux/megaglest_editor
|
|
|
|
mk/linux/megaglest_g3dviewer
|
|
|
|
mk/linux/*.ini
|
|
|
|
!mk/linux/glest-dev.ini
|
|
|
|
|
2021-06-17 01:59:39 +02:00
|
|
|
build-win64:
|
|
|
|
# The CMake configure and build commands are platform agnostic and should work equally
|
|
|
|
# well on Windows or Mac. You can convert this to a matrix build if you need
|
|
|
|
# cross-platform coverage.
|
|
|
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
arch: [x64]
|
|
|
|
build_type: [Release]
|
|
|
|
include:
|
|
|
|
- build_type: Release
|
|
|
|
release: 'ON'
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-06-17 21:40:42 +02:00
|
|
|
- name: Cache Vcpkg Libs
|
|
|
|
uses: actions/cache@v2
|
2021-06-17 21:43:30 +02:00
|
|
|
env:
|
|
|
|
cache-name: cache-vcpkg-deps
|
|
|
|
with:
|
|
|
|
path: c:/vcpkg/installed
|
|
|
|
key: vcpkg-deps
|
2021-06-17 21:40:42 +02:00
|
|
|
|
2021-06-17 01:59:39 +02:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
vcpkg integrate install
|
|
|
|
vcpkg install brotli:x64-windows-static
|
|
|
|
vcpkg install bzip2:x64-windows-static
|
|
|
|
vcpkg install curl:x64-windows-static
|
|
|
|
vcpkg install expat:x64-windows-static
|
|
|
|
vcpkg install freetype:x64-windows-static
|
|
|
|
vcpkg install fribidi:x64-windows-static
|
|
|
|
vcpkg install ftgl:x64-windows-static
|
|
|
|
vcpkg install glew:x64-windows-static
|
|
|
|
vcpkg install libiconv:x64-windows-static
|
|
|
|
vcpkg install libjpeg-turbo:x64-windows-static
|
|
|
|
vcpkg install liblzma:x64-windows-static
|
|
|
|
vcpkg install libogg:x64-windows-static
|
|
|
|
vcpkg install libpng:x64-windows-static
|
|
|
|
vcpkg install libvorbis:x64-windows-static
|
|
|
|
vcpkg install libxml2:x64-windows-static
|
|
|
|
vcpkg install lua:x64-windows-static
|
|
|
|
vcpkg install openal-soft:x64-windows-static
|
|
|
|
vcpkg install opengl:x64-windows-static
|
|
|
|
vcpkg install miniupnpc:x64-windows-static
|
|
|
|
vcpkg install sdl2:x64-windows-static
|
|
|
|
vcpkg install sqlite3:x64-windows-static
|
|
|
|
vcpkg install tiff:x64-windows-static
|
|
|
|
vcpkg install tool-meson:x64-windows-static
|
|
|
|
vcpkg install wxwidgets:x64-windows-static
|
|
|
|
vcpkg install xerces-c:x64-windows-static
|
|
|
|
vcpkg install zlib:x64-windows-static
|
|
|
|
|
|
|
|
- name: Configure CMake
|
|
|
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
|
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
|
|
# Kinda guessing this using supertux + my own build scripts as guides.
|
|
|
|
run: cmake --no-warn-unused-cli -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -T host=x64 -A x64 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
|
|
|
|
|
2021-06-17 21:40:42 +02:00
|
|
|
- name: Build Mega Glest
|
2021-06-17 01:59:39 +02:00
|
|
|
# Build your program with the given configuration
|
|
|
|
run: cmake --build ${{github.workspace}}/build --config Release --target ALL_BUILD
|
2021-06-17 21:40:42 +02:00
|
|
|
|
2021-06-18 02:27:58 +02:00
|
|
|
- name: Get Additional Dependencies
|
2021-06-18 03:03:30 +02:00
|
|
|
# Make a copy of 7z.exe
|
2021-06-17 21:40:42 +02:00
|
|
|
run: |
|
|
|
|
cd mk/windoze
|
2021-06-18 22:24:55 +02:00
|
|
|
cp ..\shared\*.ini .
|
2021-06-18 03:03:30 +02:00
|
|
|
$7zPath = $(Get-Command 7z).Source
|
|
|
|
cp $7zPath .
|
2021-06-17 21:40:42 +02:00
|
|
|
cd ../..
|
2021-06-18 02:24:22 +02:00
|
|
|
|
|
|
|
- name: Create Mega Glest Snapshot
|
2021-06-17 21:40:42 +02:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: megaglest-x64-snapshot
|
2021-06-18 02:24:22 +02:00
|
|
|
path: |
|
|
|
|
mk/windoze/*.exe
|
2021-06-18 22:24:55 +02:00
|
|
|
mk/windoze/*.ini
|
|
|
|
!mk/windoze/glest-dev.ini
|
2021-06-17 01:59:39 +02:00
|
|
|
|
|
|
|
# - name: Test
|
|
|
|
# working-directory: ${{github.workspace}}/build
|
|
|
|
# Execute tests defined by the CMake configuration.
|
|
|
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
|
|
# run: ctest -C ${{env.BUILD_TYPE}}
|