2019-11-29 21:53:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2019-12-21 03:13:37 +01:00
|
|
|
# Install export templates
|
2020-03-16 23:21:33 +01:00
|
|
|
wget https://downloads.tuxfamily.org/godotengine/3.2.1/Godot_v3.2.1-stable_export_templates.tpz --quiet
|
2019-11-29 21:53:20 +01:00
|
|
|
mkdir ~/.cache
|
|
|
|
mkdir -p ~/.config/godot
|
2020-03-16 23:21:33 +01:00
|
|
|
mkdir -p ~/.local/share/godot/templates/3.2.1.stable
|
|
|
|
unzip Godot_v3.2.1-stable_export_templates.tpz
|
|
|
|
mv templates/* ~/.local/share/godot/templates/3.2.1.stable
|
|
|
|
rm -f Godot_v3.2.1-stable_export_templates.tpz
|
2019-11-29 21:53:20 +01:00
|
|
|
|
2019-12-21 03:13:37 +01:00
|
|
|
if [ "$3" != "" ]
|
2019-11-30 22:44:28 +01:00
|
|
|
then
|
2019-12-21 03:13:37 +01:00
|
|
|
SubDirectoryLocation="$3/"
|
2019-11-30 22:44:28 +01:00
|
|
|
fi
|
|
|
|
|
2020-03-16 23:10:19 +01:00
|
|
|
mode="export"
|
|
|
|
if [ "$6" = "true" ]
|
|
|
|
then
|
|
|
|
mode="export-debug"
|
|
|
|
fi
|
|
|
|
|
2019-12-21 03:13:37 +01:00
|
|
|
# Export for project
|
2019-12-29 11:35:48 +01:00
|
|
|
echo "Building $1 for $2"
|
2020-02-01 05:40:30 +01:00
|
|
|
mkdir -p ~/build/${SubDirectoryLocation:-""}
|
|
|
|
cd ${5-"~"}
|
2020-03-16 23:10:19 +01:00
|
|
|
godot --${mode} $2 ~/build/${SubDirectoryLocation:-""}$1
|
2020-02-01 05:40:30 +01:00
|
|
|
cd ~
|
2019-11-29 21:53:20 +01:00
|
|
|
|
2020-02-01 05:40:30 +01:00
|
|
|
echo ::set-output name=build::~/build/${SubDirectoryLocation:-""}
|
2019-11-29 21:53:20 +01:00
|
|
|
|
2020-03-16 23:10:19 +01:00
|
|
|
|
2019-12-21 03:13:37 +01:00
|
|
|
if [ "$4" = "true" ]
|
2019-11-30 22:44:28 +01:00
|
|
|
then
|
2020-02-01 05:40:30 +01:00
|
|
|
mkdir ~/package
|
|
|
|
cd ~/build
|
2020-02-01 05:44:49 +01:00
|
|
|
zip ~/package/artifact.zip ${SubDirectoryLocation:-"."} -r
|
2020-02-01 05:40:30 +01:00
|
|
|
echo ::set-output name=artifact::~/package/artifact.zip
|
2019-12-29 11:35:48 +01:00
|
|
|
fi
|