2019-11-29 21:53:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2020-04-04 14:16:27 +02:00
|
|
|
# Move godot templates already installed from the docker image to home
|
2023-07-10 21:31:28 +02:00
|
|
|
mkdir -v -p ~/.local/share/godot/export_templates
|
2024-04-23 01:32:16 +02:00
|
|
|
cp -a /root/.local/share/godot/export_templates/. ~/.local/share/godot/export_templates/
|
2023-07-10 21:31:28 +02:00
|
|
|
|
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
|
|
|
|
|
2023-07-10 21:31:28 +02:00
|
|
|
mode="export-release"
|
2020-03-16 23:10:19 +01:00
|
|
|
if [ "$6" = "true" ]
|
|
|
|
then
|
2020-05-04 03:16:17 +02:00
|
|
|
echo "Exporting in debug mode!"
|
2020-03-16 23:10:19 +01:00
|
|
|
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-05-04 03:16:17 +02:00
|
|
|
mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}
|
2023-05-06 23:35:27 +02:00
|
|
|
cd "$GITHUB_WORKSPACE/$5"
|
2023-07-10 21:31:28 +02:00
|
|
|
godot --headless --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1
|
2020-05-04 03:16:17 +02:00
|
|
|
echo "Build Done"
|
2019-11-29 21:53:20 +01:00
|
|
|
|
2020-05-04 03:16:17 +02: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-05-04 03:16:17 +02:00
|
|
|
echo "Packing Build"
|
|
|
|
mkdir -p $GITHUB_WORKSPACE/package
|
|
|
|
cd $GITHUB_WORKSPACE/build
|
|
|
|
zip $GITHUB_WORKSPACE/package/artifact.zip ${SubDirectoryLocation:-"."} -r
|
|
|
|
echo ::set-output name=artifact::package/artifact.zip
|
|
|
|
echo "Done"
|
2019-12-29 11:35:48 +01:00
|
|
|
fi
|