Skip to content

CMaNGOS Classic Ubuntu Build #588

CMaNGOS Classic Ubuntu Build

CMaNGOS Classic Ubuntu Build #588

name: CMaNGOS Classic Ubuntu Build
# use manual run
#on: [workflow_dispatch]
# use schedule
on:
schedule:
# every day at 6am
- cron: '15 6 * * *'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
CORE_TYPE: "cmangos"
CORE_EXPANSION: "classic"
CORE_BRANCH: "ike3-bots"
BOTS_BRANCH: "master"
CORE_REPO_OWNER: ${{github.repository_owner}}
REPO_DIR : ${{github.workspace}}
BUILD_DIR: ${{github.workspace}}/bin/builddir
BOOST_PLATFORM_VERSION: "20.04"
BOOST_VERSION: "1.79.0"
BOOST_INSTALL_DIR: "${{github.workspace}}/bin"
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
include:
- os: ubuntu-20.04
COMPILER_CC: gcc
COMPILER_PP: g++
USE_PCH: ON
EXTRA_BUILD: "-DBUILD_EXTRACTORS=ON -DBUILD_PLAYERBOTS=ON -DBUILD_AHBOT=ON -DBUILD_GIT_ID=ON -DBUILD_MODULES=ON -DBUILD_MODULE_ACHIEVEMENTS=ON -DBUILD_MODULE_DUALSPEC=ON -DBUILD_MODULE_HARDCORE=ON -DBUILD_MODULE_IMMERSIVE=ON -DBUILD_MODULE_TRANSMOG=ON -DBUILD_MODULE_BARBER=ON"
- os: ubuntu-20.04
COMPILER_CC: clang
COMPILER_PP: clang++
USE_PCH: ON
EXTRA_BUILD: "-DBUILD_EXTRACTORS=ON -DBUILD_PLAYERBOTS=ON -DBUILD_AHBOT=ON -DBUILD_GIT_ID=ON -DBUILD_MODULES=ON -DBUILD_MODULE_ACHIEVEMENTS=ON -DBUILD_MODULE_DUALSPEC=ON -DBUILD_MODULE_HARDCORE=ON -DBUILD_MODULE_IMMERSIVE=ON -DBUILD_MODULE_TRANSMOG=ON -DBUILD_MODULE_BARBER=ON"
#- os: ubuntu-20.04
# COMPILER_CC: clang
# COMPILER_PP: clang++
# USE_PCH: OFF
# EXTRA_BUILD: ""
steps:
- name: Checkout Core
uses: actions/checkout@v2
with:
repository: ${{env.CORE_REPO_OWNER}}/mangos-classic
ref: ${{env.CORE_BRANCH}}
path: ${{env.REPO_DIR}}
- name: Create Build Environment
run: |
echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "CC=${{matrix.COMPILER_CC}}" >> $GITHUB_ENV
echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV
cmake -E make_directory ${{ env.BUILD_DIR }}
- name: Cache boost
uses: actions/cache@v2
id: cache-boost
with:
path: "${{env.BOOST_INSTALL_DIR}}/boost"
key: ${{ runner.os }}-boost
- if: steps.cache-boost.outputs.cache-hit != 'true'
name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: ${{env.BOOST_VERSION}}
# OPTIONAL: Specify a platform version
platform_version: ${{env.BOOST_PLATFORM_VERSION}}
# OPTIONAL: Specify a custom install location
boost_install_dir: ${{env.BOOST_INSTALL_DIR}}
# OPTIONAL: Specify a toolset
toolset: ${{env.COMPILER_CC}}
# OPTIONAL: Specify an architecture
arch: x86
- name: Configure
env:
USE_PCH: ${{ matrix.USE_PCH }}
EXTRA_BUILD: ${{ matrix.EXTRA_BUILD }}
BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost"
run: cmake -DBoost_ARCHITECTURE=-x64 -DPCH=${{env.USE_PCH}} ${{env.EXTRA_BUILD}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}}
- name: Build
env:
MAKEFLAGS: "-j8"
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}}
notify-success:
name: Discord release successfully notification
runs-on: ubuntu-20.04
permissions:
contents: none
needs:
- build
if: success()
steps:
- name: Notify
uses: rjstone/[email protected]
with:
severity: info
username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}}
description: |
**Classic Linux build success!**
details: |
[**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}})
footer: Build success
webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
avatarUrl: https://github.githubassets.com/favicons/favicon-success.png
notify:
name: Discord Notification
runs-on: ubuntu-20.04
permissions:
contents: none
needs: # make sure the notification is sent AFTER the jobs you want included have completed
- build
if: failure()
steps:
- name: Notify
uses: rjstone/[email protected]
with:
severity: error
username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}}
description: |
**Classic Linux build failed!**
details: |
[**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}})
footer: Build fail
webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png