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

39 lines
996 B
Bash
Raw Normal View History

#!/bin/sh
set -e
# Move godot templates already installed from the docker image to home
mkdir -v -p ~/.local/share/godot/export_templates
2024-08-21 22:34:26 +03:00
cp -a /root/.local/share/godot/export_templates/. ~/.local/share/godot/export_templates/ 2>/dev/null || :
if [ "$3" != "" ]
then
SubDirectoryLocation="$3/"
fi
mode="export-release"
2020-03-17 00:10:19 +02:00
if [ "$6" = "true" ]
then
echo "Exporting in debug mode!"
2020-03-17 00:10:19 +02:00
mode="export-debug"
fi
# Export for project
echo "Building $1 for $2"
mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}
cd "$GITHUB_WORKSPACE/$5"
godot --headless --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1
echo "Build Done"
2024-04-30 14:23:26 +03:00
echo build=build/${SubDirectoryLocation:-""} >> $GITHUB_OUTPUT
2020-03-17 00:10:19 +02:00
if [ "$4" = "true" ]
then
echo "Packing Build"
mkdir -p $GITHUB_WORKSPACE/package
cd $GITHUB_WORKSPACE/build
zip $GITHUB_WORKSPACE/package/artifact.zip ${SubDirectoryLocation:-"."} -r
2024-04-30 14:23:26 +03:00
echo artifact=package/artifact.zip >> $GITHUB_OUTPUT
echo "Done"
fi