From bd923acf4e16b3c0e1291e572c5eebb6cf51a6aa Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Tue, 5 Dec 2023 14:29:09 +0100 Subject: [PATCH] add windows build step --- .github/workflows/build-windows.yml | 31 +++++++++++++++++++++++++++++ scripts/windows/1-configure.sh | 5 +++++ scripts/windows/2-build-tests.sh | 5 +++++ scripts/windows/2-build.sh | 5 +++++ 4 files changed, 46 insertions(+) create mode 100644 .github/workflows/build-windows.yml create mode 100644 scripts/windows/1-configure.sh create mode 100755 scripts/windows/2-build-tests.sh create mode 100755 scripts/windows/2-build.sh diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..15e775c --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,31 @@ +name: Windows + +on: [push] + +jobs: + windows-build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11 + with: + runVcpkgInstall: true + + - name: Create Build Environment + shell: bash + run: ./scripts/windows/1-configure.sh '-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake' + + - name: Build Server + shell: bash + run: bash ./scripts/windows/2-build.sh + + - name: Archive server artifact + uses: actions/upload-artifact@v2 + with: + name: BeamMP-Server-windows + path: ./bin/BeamMP-Server.exe + diff --git a/scripts/windows/1-configure.sh b/scripts/windows/1-configure.sh new file mode 100644 index 0000000..0f58888 --- /dev/null +++ b/scripts/windows/1-configure.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +cmake . -B bin $1 -DCMAKE_BUILD_TYPE=Release -DBeamMP-Server_ENABLE_LTO=ON diff --git a/scripts/windows/2-build-tests.sh b/scripts/windows/2-build-tests.sh new file mode 100755 index 0000000..aa68e15 --- /dev/null +++ b/scripts/windows/2-build-tests.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +cmake --build bin --parallel -t BeamMP-Server-tests diff --git a/scripts/windows/2-build.sh b/scripts/windows/2-build.sh new file mode 100755 index 0000000..28fee9b --- /dev/null +++ b/scripts/windows/2-build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +cmake --build bin --parallel -t BeamMP-Server