17 Commits

Author SHA1 Message Date
3ba8e158e1 Merge pull request #7 from josephbmanley/feature/debugMode
Add DebugMode & Update Version
2020-03-16 18:30:23 -04:00
6d0ae9595d DOCUMENTATION: Update 'ReadMe.md' with debugMode 2020-03-16 18:28:33 -04:00
e8c3cda194 BUGFIX: Update Godot version
BUGFIX: Update Godot version
2020-03-16 18:24:16 -04:00
db6bac2426 BUGFIX: Update test project config 2020-03-16 18:17:45 -04:00
f66e81a876 FEATURE: Optionally implement 2020-03-16 18:10:19 -04:00
baa1c00e61 Update ReadMe.md 2020-02-01 00:09:17 -05:00
f407dbba9d Update ReadMe.md 2020-02-01 00:05:56 -05:00
4cae4d82be Merge pull request #4 from josephbmanley/bugfix/failures
Bugfix/failures
2020-02-01 00:02:27 -05:00
0fb921d27d Update test
Update test

Update test

Update test

Update test
2020-02-01 00:00:26 -05:00
9acd6abd7d Scripts changes & Test 2020-01-31 23:40:30 -05:00
0782209122 Merge pull request #3 from josephbmanley/pipeline/semver
Implement auto-semver for releases
2020-01-31 23:26:14 -05:00
84b6b4932b Implement auto-semver for releases 2020-01-31 23:25:56 -05:00
4286170da9 Merge pull request #2 from Tadaboody/patch-1
Fix prints in entrypoints
2019-12-31 14:40:46 -05:00
64b5e9f54f Fix prints in entrypoints
Looks like you didn't update the echos
2019-12-29 12:35:48 +02:00
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
11 changed files with 210 additions and 60 deletions

11
.bumpversion.cfg Normal file
View File

@ -0,0 +1,11 @@
[bumpversion]
current_version = 0.0.0
commit = False
tag = True
tag_name = {new_version}
[semver]
main_branches = master
major_branches =
minor_branches = feature
patch_branches = hotfix, bugfix

17
.github/workflows/test_action.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Test Action
on: push
jobs:
TestAction:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run Action
uses: ./
with:
name: test_project
preset: linux
projectDir: test_project
package: 'true'

30
.github/workflows/version.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Version & Release
on:
push:
branches:
- master
jobs:
CheckVersion:
runs-on: ubuntu-latest
container:
image: rightbrainnetworks/auto-semver
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run Auto-Semver
id: semver
uses: RightBrain-Networks/semver-action@1.0.0
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: steps['semver']['outputs']['RETURN_STATUS'] == '0'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
release_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
body: Release Version ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
draft: false
prerelease: false

View File

@ -1,40 +1,61 @@
![Release Version](https://img.shields.io/github/v/release/josephbmanley/build-godot-action) ![Test Action](https://github.com/josephbmanley/build-godot-action/workflows/Test%20Action/badge.svg)
# Build Godot Project
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
## 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
Eg. `project` will export to `$GITHUB_WORKSPACE/build/windows/project/godot-project.exe`
*Optional*
- #### PACKAGE
The subdirectory in the `build` folder to output build to, can be useful for self packaging.
Boolean value on whether or not to zip game files. Packages will be placed in the `$GITHUB_WORKSPACE/package` directory.
#### package
*Optional*
Boolean value, when set to true, builds artficat zip file.
#### debugMode
*Optional*
Boolean value, when set to true, runs export in debug mode.
### Outputs
#### build
The location the outputed build is placed.
#### artifact
The location the outputed artifact is placed.
Default Value: `false`
## Credits

View File

@ -1,9 +1,34 @@
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
projectDir:
description: 'Location of Godot project in repository'
debugMode:
description: 'Whether or not to use `--export-debug`'
default: false
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.name }}
- ${{ inputs.preset }}
- ${{ inputs.subdirectory }}
- ${{ inputs.package }}
- ${{ inputs.projectDir }}
- ${{ inputs.debugMode }}
branding:
icon: loader
color: blue

View File

@ -1,55 +1,40 @@
#!/bin/sh
set -e
workDir=`pwd`
platforms="linux windows mac html5"
wget https://downloads.tuxfamily.org/godotengine/3.1.1/Godot_v3.1.1-stable_export_templates.tpz --quiet
# Install export templates
wget https://downloads.tuxfamily.org/godotengine/3.2.1/Godot_v3.2.1-stable_export_templates.tpz --quiet
mkdir ~/.cache
mkdir -p ~/.config/godot
mkdir -p ~/.local/share/godot/templates/3.1.1.stable
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
mkdir -p ~/.local/share/godot/templates/3.2.1.stable
unzip Godot_v3.2.1-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/templates/3.2.1.stable
rm -f Godot_v3.2.1-stable_export_templates.tpz
if [ "${SUBDIRECTORY}" != "" ]
if [ "$3" != "" ]
then
SubDirectoryLocation="${SUBDIRECTORY}/"
SubDirectoryLocation="$3/"
fi
# Export for Linux
echo "Building ${PROJECT} for Linux"
mkdir -p ./build/linux/${SubDirectoryLocation:-""}
godot --export Linux/X11 ./build/linux/${SubDirectoryLocation:-""}${PROJECT}
# Export for Windows
echo "Building ${PROJECT} for Windows"
mkdir -p ./build/windows/${SubDirectoryLocation:-""}
godot --export "Windows Desktop" ./build/windows/${SubDirectoryLocation:-""}${PROJECT}.exe
# Export for OSX
echo "Building ${PROJECT} for OSX"
mkdir -p ./build/mac/${SubDirectoryLocation:-""}
godot --export "Mac OSX" ./build/mac/${SubDirectoryLocation:-""}${PROJECT}
# Export for HTML5
echo "Building ${PROJECT} for HTML5"
mkdir -p ./build/html5/${SubDirectoryLocation:-""}
godot --export "HTML5" ./build/html5/${SubDirectoryLocation:-""}index.html
mkdir ${workDir}/package
if [ ${PACKAGE:-"false"} = "true" ]
mode="export"
if [ "$6" = "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
mode="export-debug"
fi
# Export for project
echo "Building $1 for $2"
mkdir -p ~/build/${SubDirectoryLocation:-""}
cd ${5-"~"}
godot --${mode} $2 ~/build/${SubDirectoryLocation:-""}$1
cd ~
echo ::set-output name=build::~/build/${SubDirectoryLocation:-""}
if [ "$4" = "true" ]
then
mkdir ~/package
cd ~/build
zip ~/package/artifact.zip ${SubDirectoryLocation:-"."} -r
echo ::set-output name=artifact::~/package/artifact.zip
fi

View File

@ -0,0 +1,3 @@
source_md5="0167658bc4406f0d0fe437e0197c415a"
dest_md5="64b0613b3173e1e1c96dd18b6569e62d"

View File

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

View File

@ -0,0 +1,3 @@
[gd_scene format=2]
[node name="Node2D" type="Node2D"]

View File

@ -0,0 +1,25 @@
[preset.0]
name="linux"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../test_project.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.0.options]
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""

View File

@ -0,0 +1,23 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="test_project"
run/main_scene="res://empty_scene.tscn"
[rendering]
environment/default_environment="res://default_env.tres"