8 Commits

Author SHA1 Message Date
36ac8f7987 Build zips to ./package directory
BUGFIX: spacing

. -> *

Subdirectory /

Subdirectory path

Create subdir

Echo platform build

Conditional zip

debug
2019-11-30 21:01:28 -05:00
b6670be025 Merge branch 'master' of github.com:josephbmanley/build-godot-action 2019-11-30 00:05:24 -05:00
e8b4e439a5 BUGFIX - SUBDIR 2019-11-30 00:05:16 -05:00
f41cbbd786 Update ReadMe.md 2019-11-29 23:57:53 -05:00
337ddc6155 Merge branch 'master' of github.com:josephbmanley/build-godot-action 2019-11-29 23:55:57 -05:00
a8c36a5f54 Add subdirectories 2019-11-29 23:55:42 -05:00
4c54598c55 Update ReadMe.md 2019-11-29 23:34:12 -05:00
0ca1161ddb Update ReadMe.md
Fixes the tag used in the example.
2019-11-29 18:40:21 -05:00
3 changed files with 49 additions and 9 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.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>"

View File

@ -1,4 +1,4 @@
# Build Godot
# Build Godot Project
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
@ -10,9 +10,10 @@ Example:
```yaml
steps:
- uses: josephbmanley/build-godot-action@develop
- uses: josephbmanley/build-godot-action@master
env:
PROJECT: godot-project
SUBDIRECTORY: project
```
### Environment Variables
@ -23,6 +24,18 @@ steps:
Eg. `godot-project` will export to `godot-project.exe`
- #### SUBDIRECTORY
Subdirectory to export project into.
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)

View File

@ -1,6 +1,9 @@
#!/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
mkdir -p ~/.config/godot
@ -9,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/${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/${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/${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