Update github actions workflow

- Uses matrix so that build steps don't need to be defined multiple
  times.
- Caches godot-cpp bindings, so they only need to be built when the
  submodule version changes.
- Uploads build artifacts for linux 32/64-bit, windows 64-bit and macOS
  64-bit.
This commit is contained in:
Leroy Hopson 2020-11-20 21:34:49 +07:00 committed by Leroy Hopson
parent e850bc952f
commit b2dc46636c
4 changed files with 75 additions and 65 deletions

View file

@ -69,11 +69,6 @@ Help(opts.GenerateHelpText(env))
# Add PATH to environment so scons can find commands such as g++, etc.
env.AppendENVPath('PATH', os.getenv('PATH'))
# Generate godot-cpp bindings.
# Options such as platform, target, etc. will be forwarded to the godot-cpp SConscript.
ARGUMENTS['generate_bindings'] = True
SConscript('external/godot-cpp/SConstruct')
# Compile for Linux.
if env['platform'] == 'linux':

View file

@ -26,24 +26,10 @@ if [ ! -d "${GODOT_CPP_DIR}" ]; then
git submodule update --init --recursive -- $GODOT_CPP_DIR
fi
# Build godot-cpp bindings.
cd ${GODOT_CPP_DIR}
scons generate_bindings=yes -j$(nproc)
# Build libgodot-xterm.
cd ${NATIVE_DIR}
case $1 in
"release-all")
# Cross-compile release build for all platforms.
scons platform=linux bits=64 target=release -j$(nproc)
if [ $IN_NIX_SHELL ]; then
nix-shell --pure --argstr system i686-linux --run "NIX_PATH=${NIX_PATH} scons platform=linux bits=32 target=release -j$(nproc)"
else
scons platform=linux bits=32 target=release -j$(nproc)
fi
scons platform=windows bits=64 target=release -j$(nproc)
#scons platform=windows bits=32 target=release -j$(nproc)
#scons platform=osx bits=64 target=release -j$(nproc)
;;
*)
# Default: Compile debug build for the current platform.
scons -j$(nproc)
;;
esac
scons -j$(nproc)