feat: console input editing with *replxx* #313
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: Server | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'BallanceMMOClient/**' | |
- '.git*' | |
- 'README.md' | |
- '.github/workflows/client.yml' | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- 'BallanceMMOClient/**' | |
- '.git*' | |
- 'README.md' | |
- '.github/workflows/client.yml' | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build-server-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch git submodules | |
run: git submodule update --init --recursive | |
- name: Install dependencies (OpenSSL, Protobuf) | |
run: sudo apt install libssl-dev libprotobuf-dev protobuf-compiler | |
- 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 | |
run: | | |
echo -e "\nfile(WRITE version.txt \${BMMO_VER})" >> CMakeLists.txt | |
cmake -B ${{github.workspace}}/build -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SERVER=ON -DBUILD_CLIENT=OFF | |
echo "BMMO_VER=$(cat version.txt)" >> "$GITHUB_ENV" | |
echo "SHA_SHORT=$(git rev-parse --short ${{github.sha}})" >> "$GITHUB_ENV" | |
- name: Build | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}} | |
# 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}} | |
- name: Release Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: server-linux-${{env.BMMO_VER}}-${{env.SHA_SHORT}} | |
path: build/BallanceMMOServer | |
build-server-windows: | |
runs-on: windows-latest | |
env: | |
VCPKG_ROOT: ${{github.workspace}}/submodule/vcpkg | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: lukka/get-cmake@latest | |
- name: Fetch git submodules | |
run: git submodule update --init --recursive | |
# Setup MSVC command prompt environment vars | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- name: Restore artifacts, setup vcpkg | |
uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: 861c33057553ee836e7061ffbdabc25ea343145d | |
vcpkgDirectory: '${{env.VCPKG_ROOT}}' | |
vcpkgJsonGlob: vcpkg.json | |
runVcpkgInstall: false | |
# - name: vcpkg check / install dependencies | |
# working-directory: ${{env.VCPKG_ROOT}} | |
# run: vcpkg install --triplet x64-windows | |
- name: Configure CMake | |
run: | | |
echo "`nfile(WRITE version.txt `${BMMO_VER})" | Out-File CMakeLists.txt -Encoding "UTF8" -Append | |
cmake -B ${{github.workspace}}/build -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_MODE=ON -DVCPKG_MANIFEST_DIR="${{github.workspace}}" -DYAML_BUILD_SHARED_LIBS=ON -DBUILD_SERVER=ON -DBUILD_CLIENT=OFF | |
echo "BMMO_VER=$(cat version.txt)" >> $env:GITHUB_ENV | |
echo "SHA_SHORT=$(git rev-parse --short ${{github.sha}})" >> $env:GITHUB_ENV | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
# - name: List build dir | |
# working-directory: ${{github.workspace}}/build | |
# run: dir | |
# - name: Run post-build script | |
# working-directory: ${{github.workspace}}/build/BallanceMMOServer | |
# run: ${{github.workspace}}/build/BallanceMMOServer/postbuild.bat ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}} | |
run: ctest -C ${{env.BUILD_TYPE}} | |
- name: Dry run | |
working-directory: ${{github.workspace}}/build/BallanceMMOServer/${{env.BUILD_TYPE}} | |
run: ${{github.workspace}}/build/BallanceMMOServer/${{env.BUILD_TYPE}}/BallanceMMOServer.exe --dry-run | |
- name: Release Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: server-windows-${{env.BMMO_VER}}-${{env.SHA_SHORT}} | |
path: build/BallanceMMOServer/${{env.BUILD_TYPE}} |