diff --git a/.gitea/scripts/ci.sh b/.gitea/scripts/ci.sh new file mode 100755 index 0000000..6772dfa --- /dev/null +++ b/.gitea/scripts/ci.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# setup +mkdir build +cd build +mkdir iw4 +mkdir iw5 +cd .. + +cp iw4/scripts/mp/_jump.gsc build/iw4 + +# replace gsc extension with c so GCC is happy +mv iw5/scripts/mp/_jump.gsc iw5/scripts/mp/_jump.c + +# perform macro expansion +gcc -D_UTILITY_DEBUG -DIW5 -DCI -E "iw5/scripts/mp/_jump.c" -o _jump.in + +mv _jump.in build/iw5/_jump.gsc diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..4c6fec1 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,26 @@ +name: Build + +on: [push] +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Check out files + uses: actions/checkout@main + with: + submodules: true + fetch-depth: 0 + lfs: false + + - name: Create release + run: | + ./gitea/scripts/ci.sh + + - name: Upload release + uses: actions/upload-artifact@main + with: + name: release + path: | + build/iw4/_jump.gsc + build/iw5/_jump.gsc diff --git a/iw5/scripts/mp/_jump.gsc b/iw5/scripts/mp/_jump.gsc index 3f8fc0c..bbf6bf5 100644 --- a/iw5/scripts/mp/_jump.gsc +++ b/iw5/scripts/mp/_jump.gsc @@ -4,7 +4,11 @@ #define TOOL #endif +#if !defined(TOOL) #inline scripts\mp\_utility; +#else +#include "_utility.gsh" +#endif GENERIC_INIT; @@ -14,7 +18,9 @@ onPlayerConnect() { level waittill( "connected", player ); +#if defined(TOOL) waittillframeend; +#endif BOT_CHK( player );