10 Commits

Author SHA1 Message Date
e3271898b4 Merge pull request #1 from josephbmanley/refactor/build
Refactor/build
2019-12-28 16:59:19 -05:00
7286d00fbc Update README.md with refactor info 2019-12-28 16:57:55 -05:00
25441faa20 Refactor building to target platform
Refactor artifact output

== -> =
2019-12-28 16:57:53 -05:00
4940f3b222 Add html5 to packaging 2019-12-05 03:32:27 -05:00
7c6b524ff2 BUGFIX: HTML5 Build dir 2019-12-05 03:31:57 -05:00
8958f9cefe BUGFIX: HTML5 Build 2019-12-03 21:57:15 -05:00
00d186c313 BUGFIX: HTML5 Build 2019-12-03 21:27:06 -05:00
bb3ca4865b Fix build directory path 2019-12-03 21:14:51 -05:00
545a327e1b HTML5 Support 2019-12-03 21:03:02 -05:00
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
4 changed files with 68 additions and 23 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

@ -4,31 +4,50 @@ This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you ca
## Usage
This action will create a `build` folder with subdirectories for linux, windows, and mac. You must have the export preset configured for each platform to successfully export.
This action will create a `build` folder an outputed build. You must have the export preset configured for the target platform to successfully export.
Example:
```yaml
steps:
- uses: josephbmanley/build-godot-action@master
env:
PROJECT: godot-project
SUBDIRECTORY: project
- uses: josephbmanley/build-godot-action@[VERSION]
with:
name: godot-project
preset: HTML5
```
### Environment Variables
### Inputs
- #### PROJECT **REQUIRED**
#### name **required**
Name of the project files to output.
The name of the exported package/binary
Eg. `godot-project` will export to `godot-project.exe`
#### preset **required**
- #### SUBDIRECTORY
The name of the preset found in `export_presets.cfg` you would like to build.
Subdirectory to export project into.
#### subdirectory
*Optional*
The subdirectory in the `build` folder to output build to, can be useful for self packaging.
#### package
*Optional*
Boolean value, when set to true, builds artficat zip file.
### Outputs
#### build
The location the outputed build is placed.
#### artifact
The location the outputed artifact is placed.
Eg. `project` will export to `$GITHUB_WORKSPACE/build/windows/project/godot-project.exe`
## Credits

View File

@ -1,9 +1,27 @@
name: "Build Godot"
description: "Build a Godot project for multiple platforms"
author: josephbmanley
inputs:
name:
description: 'Name of the exported binary'
required: true
preset:
description: 'Name of the preset in `export_presets.cfg` to use'
required: true
subdirectory:
description: 'Optional name of the subdirectory to put exported project in'
required: false
package:
description: 'Set true to output an artifact zip file'
required: false
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.name }}
- ${{ inputs.preset }}
- ${{ inputs.subdirectory }}
- ${{ inputs.package }}
branding:
icon: loader
color: blue

View File

@ -1,8 +1,9 @@
#!/bin/sh
set -e
workDir=`pwd`
# Install export templates
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
mkdir ~/.cache
mkdir -p ~/.config/godot
@ -11,14 +12,22 @@ 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
# Export for Linux
mkdir -p ./build/linux
godot --export Linux/X11 ./build/linux/${SUBDIRECTORY:-""}${PROJECT}
if [ "$3" != "" ]
then
SubDirectoryLocation="$3/"
fi
# Export for Windows
mkdir -p ./build/windows
godot --export "Windows Desktop" ./build/windows/${SUBDIRECTORY:-""}${PROJECT}.exe
# Export for project
echo "Building ${PROJECT} for Linux"
mkdir -p `pwd`/build/${SubDirectoryLocation:-""}
godot --export $2 `pwd`/build/${SubDirectoryLocation:-""}$1
# Export for OSX
mkdir -p ./builds/mac
godot --export "Mac OSX" ./build/mac/${SUBDIRECTORY:-""}${PROJECT}
echo ::set-output name=build::`pwd`/build/${SubDirectoryLocation:-""}
if [ "$4" = "true" ]
then
mkdir `pwd`/package
cd `pwd`/build
zip `pwd`/package/artifact.zip ${SubDirectoryLocation:-"*"} -r
echo ::set-output name=artifact::`pwd`/package/artifact.zip
fi