Build zips to ./package directory

BUGFIX: spacing

. -> *

Subdirectory /

Subdirectory path

Create subdir

Echo platform build

Conditional zip

debug
This commit is contained in:
Joseph Manley 2019-11-30 16:44:28 -05:00
parent b6670be025
commit 36ac8f7987
3 changed files with 39 additions and 8 deletions

View file

@ -5,7 +5,6 @@ LABEL "com.github.actions.description"="Build a Godot project for multiple platf
LABEL "com.github.actions.icon"="loader" LABEL "com.github.actions.icon"="loader"
LABEL "com.github.actions.color"="blue" LABEL "com.github.actions.color"="blue"
LABEL version="1.0.0"
LABEL repository="https://github.com/josephbmanley/build-godot-action" LABEL repository="https://github.com/josephbmanley/build-godot-action"
LABEL homepage="https://cloudsumu.com/" LABEL homepage="https://cloudsumu.com/"
LABEL maintainer="Joseph Manley <joseph@cloudsumu.com>" LABEL maintainer="Joseph Manley <joseph@cloudsumu.com>"

View file

@ -30,6 +30,12 @@ steps:
Eg. `project` will export to `$GITHUB_WORKSPACE/build/windows/project/godot-project.exe` Eg. `project` will export to `$GITHUB_WORKSPACE/build/windows/project/godot-project.exe`
- #### PACKAGE
Boolean value on whether or not to zip game files. Packages will be placed in the `$GITHUB_WORKSPACE/package` directory.
Default Value: `false`
## Credits ## Credits
This action uses the [godot-ci](https://github.com/aBARICHELLO/godot-ci) docker image from [BARICHELLO](https://github.com/aBARICHELLO) This action uses the [godot-ci](https://github.com/aBARICHELLO/godot-ci) docker image from [BARICHELLO](https://github.com/aBARICHELLO)

View file

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
set -e set -e
workDir=`pwd`
platforms="linux windows mac"
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
mkdir ~/.cache mkdir ~/.cache
@ -11,14 +12,39 @@ unzip Godot_v3.1.1-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/templates/3.1.1.stable mv templates/* ~/.local/share/godot/templates/3.1.1.stable
rm -f Godot_v3.1.1-stable_export_templates.tpz rm -f Godot_v3.1.1-stable_export_templates.tpz
if [ "${SUBDIRECTORY}" != "" ]
then
SubDirectoryLocation="${SUBDIRECTORY}/"
fi
# Export for Linux # Export for Linux
mkdir -p ./build/linux echo "Building ${PROJECT} for Linux"
godot --export Linux/X11 ./build/linux/${SUBDIRECTORY:-""}${PROJECT} mkdir -p ./build/linux/${SubDirectoryLocation:-""}
godot --export Linux/X11 ./build/linux/${SubDirectoryLocation:-""}${PROJECT}
# Export for Windows # Export for Windows
mkdir -p ./build/windows echo "Building ${PROJECT} for Windows"
godot --export "Windows Desktop" ./build/windows/${SUBDIRECTORY:-""}${PROJECT}.exe mkdir -p ./build/windows/${SubDirectoryLocation:-""}
godot --export "Windows Desktop" ./build/windows/${SubDirectoryLocation:-""}${PROJECT}.exe
# Export for OSX # Export for OSX
mkdir -p ./builds/mac echo "Building ${PROJECT} for OSX"
godot --export "Mac OSX" ./build/mac/${SUBDIRECTORY:-""}${PROJECT} mkdir -p ./builds/mac/${SubDirectoryLocation:-""}
godot --export "Mac OSX" ./build/mac/${SubDirectoryLocation:-""}${PROJECT}
mkdir ${workDir}/package
if [ ${PACKAGE:-"false"} = "true" ]
then
for platform in $platforms
do
if [ "$(ls -A ${workDir}/build/${platform})" ]; then
echo $platform
pwd
ls
cd ${workDir}/build/${platform}
zip ${workDir}/package/${PROJECT}-${platform}.zip ${SUBDIRECTORY:-"*"} -r
else
echo "${platform} did not build!"
fi
done
fi