This repository has been archived on 2024-11-15. You can view files and clone it, but cannot push or open issues or pull requests.
build-godot-action/entrypoint.sh

55 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/sh
set -e
workDir=`pwd`
2019-12-05 10:32:27 +02:00
platforms="linux windows mac html5"
2019-11-30 06:55:42 +02:00
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
mkdir ~/.cache
mkdir -p ~/.config/godot
mkdir -p ~/.local/share/godot/templates/3.1.1.stable
unzip Godot_v3.1.1-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/templates/3.1.1.stable
rm -f Godot_v3.1.1-stable_export_templates.tpz
if [ "${SUBDIRECTORY}" != "" ]
then
SubDirectoryLocation="${SUBDIRECTORY}/"
fi
# Export for Linux
echo "Building ${PROJECT} for Linux"
mkdir -p ./build/linux/${SubDirectoryLocation:-""}
godot --export Linux/X11 ./build/linux/${SubDirectoryLocation:-""}${PROJECT}
# Export for Windows
echo "Building ${PROJECT} for Windows"
mkdir -p ./build/windows/${SubDirectoryLocation:-""}
godot --export "Windows Desktop" ./build/windows/${SubDirectoryLocation:-""}${PROJECT}.exe
# Export for OSX
echo "Building ${PROJECT} for OSX"
2019-12-04 04:14:51 +02:00
mkdir -p ./build/mac/${SubDirectoryLocation:-""}
godot --export "Mac OSX" ./build/mac/${SubDirectoryLocation:-""}${PROJECT}
2019-12-04 04:03:02 +02:00
# Export for HTML5
echo "Building ${PROJECT} for HTML5"
2019-12-04 04:57:15 +02:00
mkdir -p ./build/html5/${SubDirectoryLocation:-""}
2019-12-05 10:31:57 +02:00
godot --export "HTML5" ./build/html5/${SubDirectoryLocation:-""}index.html
2019-12-04 04:03:02 +02:00
mkdir ${workDir}/package
if [ ${PACKAGE:-"false"} = "true" ]
then
for platform in $platforms
do
if [ "$(ls -A ${workDir}/build/${platform})" ]; then
echo $platform
pwd
ls
cd ${workDir}/build/${platform}
zip ${workDir}/package/${PROJECT}-${platform}.zip ${SUBDIRECTORY:-"*"} -r
else
echo "${platform} did not build!"
fi
done
fi