mirror of
https://github.com/yeslayla/build-godot-action.git
synced 2025-07-17 21:03:49 +02:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3271898b4 | |||
7286d00fbc | |||
25441faa20 | |||
4940f3b222 | |||
7c6b524ff2 | |||
8958f9cefe | |||
00d186c313 | |||
bb3ca4865b | |||
545a327e1b | |||
36ac8f7987 | |||
b6670be025 | |||
e8b4e439a5 | |||
f41cbbd786 | |||
337ddc6155 | |||
a8c36a5f54 | |||
4c54598c55 | |||
0ca1161ddb |
@ -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>"
|
||||||
|
44
ReadMe.md
44
ReadMe.md
@ -1,27 +1,53 @@
|
|||||||
# Build Godot
|
# Build Godot Project
|
||||||
|
|
||||||
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
|
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
|
||||||
|
|
||||||
## Usage
|
## 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:
|
Example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: josephbmanley/build-godot-action@develop
|
- uses: josephbmanley/build-godot-action@[VERSION]
|
||||||
env:
|
with:
|
||||||
PROJECT: godot-project
|
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
|
||||||
|
|
||||||
|
#### preset **required**
|
||||||
|
|
||||||
|
The name of the preset found in `export_presets.cfg` you would like to build.
|
||||||
|
|
||||||
|
#### 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. `godot-project` will export to `godot-project.exe`
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
18
action.yml
18
action.yml
@ -1,9 +1,27 @@
|
|||||||
name: "Build Godot"
|
name: "Build Godot"
|
||||||
description: "Build a Godot project for multiple platforms"
|
description: "Build a Godot project for multiple platforms"
|
||||||
author: josephbmanley
|
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:
|
runs:
|
||||||
using: docker
|
using: docker
|
||||||
image: Dockerfile
|
image: Dockerfile
|
||||||
|
args:
|
||||||
|
- ${{ inputs.name }}
|
||||||
|
- ${{ inputs.preset }}
|
||||||
|
- ${{ inputs.subdirectory }}
|
||||||
|
- ${{ inputs.package }}
|
||||||
branding:
|
branding:
|
||||||
icon: loader
|
icon: loader
|
||||||
color: blue
|
color: blue
|
@ -1,6 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
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
|
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
|
||||||
mkdir ~/.cache
|
mkdir ~/.cache
|
||||||
mkdir -p ~/.config/godot
|
mkdir -p ~/.config/godot
|
||||||
@ -9,14 +12,22 @@ 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
|
||||||
|
|
||||||
# Export for Linux
|
if [ "$3" != "" ]
|
||||||
mkdir -p ./build/linux
|
then
|
||||||
godot --export Linux/X11 ./build/linux/${PROJECT}
|
SubDirectoryLocation="$3/"
|
||||||
|
fi
|
||||||
|
|
||||||
# Export for Windows
|
# Export for project
|
||||||
mkdir -p ./build/windows
|
echo "Building ${PROJECT} for Linux"
|
||||||
godot --export "Windows Desktop" ./build/windows/${PROJECT}.exe
|
mkdir -p `pwd`/build/${SubDirectoryLocation:-""}
|
||||||
|
godot --export $2 `pwd`/build/${SubDirectoryLocation:-""}$1
|
||||||
|
|
||||||
# Export for OSX
|
echo ::set-output name=build::`pwd`/build/${SubDirectoryLocation:-""}
|
||||||
mkdir -p ./builds/mac
|
|
||||||
godot --export "Mac OSX" ./build/mac/${PROJECT}
|
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
|
Reference in New Issue
Block a user