3 # gets a Godot release, fetches export templates,
4 # and builds a project with its native export options
7 DIR_DOWNLOAD=$PWD/download
8 DIR_TEMPLATES=$DIR_DOWNLOAD/templates
10 DIR_RELEASE=$PWD/release
11 DIR_PROJECT=$PWD/project
13 GODOT_VERSION=4.4-stable
14 GODOT_ZIP=Godot_v${GODOT_VERSION}_linux.x86_64.zip
15 GODOT_EXE=Godot_v${GODOT_VERSION}_linux.x86_64
16 GODOT_URI=https://github.com/godotengine/godot/releases/download/$GODOT_VERSION/$GODOT_ZIP
18 GODOT_EXPORT_TEMPLATES=Godot_v${GODOT_VERSION}_export_templates.tpz
19 GODOT_TEMPLATE_URI=https://github.com/godotengine/godot/releases/download/$GODOT_VERSION/$GODOT_EXPORT_TEMPLATES
21 GODOT=$DIR_DOWNLOAD/$GODOT_EXE
24 [[ -d $DIR_DOWNLOAD ]] || mkpath -p $DIR_DOWNLOAD
25 [[ -f $DIR_DOWNLOAD/$GODOT_ZIP ]] || wget -P $DIR_DOWNLOAD $GODOT_URI
26 [[ -f $DIR_DOWNLOAD/$GODOT_EXE ]] || unzip $DIR_DOWNLOAD/$GODOT_ZIP -d $DIR_DOWNLOAD
28 echo Godot version - $($GODOT --headless --version)
30 # get export templates
31 [[ -f $DIR_DOWNLOAD/$GODOT_EXPORT_TEMPLATES ]] || wget -P $DIR_DOWNLOAD $GODOT_TEMPLATE_URI
32 [[ -d $DIR_TEMPLATES ]] || unzip -d $DIR_DOWNLOAD $DIR_DOWNLOAD/$GODOT_EXPORT_TEMPLATES
34 GODOT_TEMPLATE_VERSION=$(cat $DIR_TEMPLATES/version.txt)
35 LOCAL_TEMPLATES=$HOME/.local/share/godot/export_templates/$GODOT_TEMPLATE_VERSION
36 if [[ ! -d $LOCAL_TEMPLATES ]]
38 mkdir -p $LOCAL_TEMPLATES
39 cp $DIR_TEMPLATES/* $LOCAL_TEMPLATES
40 # TODO: leaves extra stuff
43 echo Godot export template version - $GODOT_TEMPLATE_VERSION
44 echo Local templates - $LOCAL_TEMPLATES
46 # execute project build
48 [[ -d $DIR_RELEASE/$PLATFORM ]] || mkdir -p $DIR_RELEASE/$PLATFORM
49 [[ -d $DIR_DEBUG/$PLATFORM ]] || mkdir -p $DIR_DEBUG/$PLATFORM
51 echo Starting project build
52 $GODOT --headless --export-debug --path $DIR_PROJECT $PLATFORM $DIR_DEBUG/$PLATFORM/wolf-seeking-sheep.dmg