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

41 lines
944 B
Bash
Raw Normal View History

#!/bin/sh
set -e
# Install export templates
wget https://downloads.tuxfamily.org/godotengine/3.2.1/Godot_v3.2.1-stable_export_templates.tpz --quiet
mkdir ~/.cache
mkdir -p ~/.config/godot
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
if [ "$3" != "" ]
then
SubDirectoryLocation="$3/"
fi
2020-03-17 00:10:19 +02:00
mode="export"
if [ "$6" = "true" ]
then
mode="export-debug"
fi
# Export for project
echo "Building $1 for $2"
2020-02-01 06:40:30 +02:00
mkdir -p ~/build/${SubDirectoryLocation:-""}
cd ${5-"~"}
2020-03-17 00:10:19 +02:00
godot --${mode} $2 ~/build/${SubDirectoryLocation:-""}$1
2020-02-01 06:40:30 +02:00
cd ~
2020-02-01 06:40:30 +02:00
echo ::set-output name=build::~/build/${SubDirectoryLocation:-""}
2020-03-17 00:10:19 +02:00
if [ "$4" = "true" ]
then
2020-02-01 06:40:30 +02:00
mkdir ~/package
cd ~/build
zip ~/package/artifact.zip ${SubDirectoryLocation:-"."} -r
2020-02-01 06:40:30 +02:00
echo ::set-output name=artifact::~/package/artifact.zip
fi