mirror of
https://github.com/yeslayla/build-godot-action.git
synced 2025-12-06 09:23:31 +01:00
Refactor building to target platform
Refactor artifact output == -> =
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
set -e
|
||||
|
||||
workDir=`pwd`
|
||||
platforms="linux windows mac html5"
|
||||
|
||||
# Install export templates
|
||||
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
|
||||
mkdir ~/.cache
|
||||
mkdir -p ~/.config/godot
|
||||
@@ -12,44 +12,22 @@ 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}" != "" ]
|
||||
if [ "$3" != "" ]
|
||||
then
|
||||
SubDirectoryLocation="${SUBDIRECTORY}/"
|
||||
SubDirectoryLocation="$3/"
|
||||
fi
|
||||
|
||||
# Export for Linux
|
||||
# Export for project
|
||||
echo "Building ${PROJECT} for Linux"
|
||||
mkdir -p ./build/linux/${SubDirectoryLocation:-""}
|
||||
godot --export Linux/X11 ./build/linux/${SubDirectoryLocation:-""}${PROJECT}
|
||||
mkdir -p `pwd`/build/${SubDirectoryLocation:-""}
|
||||
godot --export $2 `pwd`/build/${SubDirectoryLocation:-""}$1
|
||||
|
||||
# Export for Windows
|
||||
echo "Building ${PROJECT} for Windows"
|
||||
mkdir -p ./build/windows/${SubDirectoryLocation:-""}
|
||||
godot --export "Windows Desktop" ./build/windows/${SubDirectoryLocation:-""}${PROJECT}.exe
|
||||
echo ::set-output name=build::`pwd`/build/${SubDirectoryLocation:-""}
|
||||
|
||||
# Export for OSX
|
||||
echo "Building ${PROJECT} for OSX"
|
||||
mkdir -p ./build/mac/${SubDirectoryLocation:-""}
|
||||
godot --export "Mac OSX" ./build/mac/${SubDirectoryLocation:-""}${PROJECT}
|
||||
|
||||
# Export for HTML5
|
||||
echo "Building ${PROJECT} for HTML5"
|
||||
mkdir -p ./build/html5/${SubDirectoryLocation:-""}
|
||||
godot --export "HTML5" ./build/html5/${SubDirectoryLocation:-""}index.html
|
||||
|
||||
mkdir ${workDir}/package
|
||||
if [ ${PACKAGE:-"false"} = "true" ]
|
||||
if [ "$4" = "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
|
||||
mkdir `pwd`/package
|
||||
cd `pwd`/build
|
||||
zip `pwd`/package/artifact.zip ${SubDirectoryLocation:-"*"} -r
|
||||
echo ::set-output name=artifact::`pwd`/package/artifact.zip
|
||||
fi
|
||||
Reference in New Issue
Block a user