mirror of
				https://github.com/yeslayla/build-godot-action.git
				synced 2025-11-04 16:23:04 +01:00 
			
		
		
		
	Build zips to ./package directory
BUGFIX: spacing . -> * Subdirectory / Subdirectory path Create subdir Echo platform build Conditional zip debug
This commit is contained in:
		@ -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.color"="blue"
 | 
			
		||||
 | 
			
		||||
LABEL version="1.0.0"
 | 
			
		||||
LABEL repository="https://github.com/josephbmanley/build-godot-action"
 | 
			
		||||
LABEL homepage="https://cloudsumu.com/"
 | 
			
		||||
LABEL maintainer="Joseph Manley <joseph@cloudsumu.com>"
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,12 @@ steps:
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
This action uses the [godot-ci](https://github.com/aBARICHELLO/godot-ci) docker image from [BARICHELLO](https://github.com/aBARICHELLO)
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
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
 | 
			
		||||
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
 | 
			
		||||
rm -f Godot_v3.1.1-stable_export_templates.tpz
 | 
			
		||||
 | 
			
		||||
if [ "${SUBDIRECTORY}" != "" ]
 | 
			
		||||
then
 | 
			
		||||
    SubDirectoryLocation="${SUBDIRECTORY}/"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Export for Linux
 | 
			
		||||
mkdir -p ./build/linux
 | 
			
		||||
godot --export Linux/X11 ./build/linux/${SUBDIRECTORY:-""}${PROJECT}
 | 
			
		||||
echo "Building ${PROJECT} for Linux"
 | 
			
		||||
mkdir -p ./build/linux/${SubDirectoryLocation:-""}
 | 
			
		||||
godot --export Linux/X11 ./build/linux/${SubDirectoryLocation:-""}${PROJECT}
 | 
			
		||||
 | 
			
		||||
# Export for Windows
 | 
			
		||||
mkdir -p ./build/windows
 | 
			
		||||
godot --export "Windows Desktop" ./build/windows/${SUBDIRECTORY:-""}${PROJECT}.exe
 | 
			
		||||
echo "Building ${PROJECT} for Windows"
 | 
			
		||||
mkdir -p ./build/windows/${SubDirectoryLocation:-""}
 | 
			
		||||
godot --export "Windows Desktop" ./build/windows/${SubDirectoryLocation:-""}${PROJECT}.exe
 | 
			
		||||
 | 
			
		||||
# Export for OSX
 | 
			
		||||
mkdir -p ./builds/mac
 | 
			
		||||
godot --export "Mac OSX" ./build/mac/${SUBDIRECTORY:-""}${PROJECT}
 | 
			
		||||
echo "Building ${PROJECT} for OSX"
 | 
			
		||||
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
 | 
			
		||||
		Reference in New Issue
	
	Block a user