diff --git a/.github/workflows/test_action.yml b/.github/workflows/test_action.yml new file mode 100644 index 0000000..ca7a1a4 --- /dev/null +++ b/.github/workflows/test_action.yml @@ -0,0 +1,21 @@ +name: Test Action + +on: push + +jobs: + TestAction: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Run Action + uses: josephbmanley/build-godot-actions@${{ steps.extract_branch.outputs.branch }} + with: + name: test_project + preset: linux + projectDir: test_project + package: 'true' \ No newline at end of file diff --git a/action.yml b/action.yml index d625999..48111ba 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,8 @@ inputs: package: description: 'Set true to output an artifact zip file' required: false + projectDir: + description: 'Location of Godot project in repository' runs: using: docker image: Dockerfile @@ -22,6 +24,7 @@ runs: - ${{ inputs.preset }} - ${{ inputs.subdirectory }} - ${{ inputs.package }} + - ${{ inputs.projectDir }} branding: icon: loader color: blue \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index f9c2ec3..205f9cf 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,6 @@ #!/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 @@ -19,15 +17,17 @@ fi # Export for project echo "Building $1 for $2" -mkdir -p `pwd`/build/${SubDirectoryLocation:-""} -godot --export $2 `pwd`/build/${SubDirectoryLocation:-""}$1 +mkdir -p ~/build/${SubDirectoryLocation:-""} +cd ${5-"~"} +godot --export $2 ~/build/${SubDirectoryLocation:-""}$1 +cd ~ -echo ::set-output name=build::`pwd`/build/${SubDirectoryLocation:-""} +echo ::set-output name=build::~/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 + mkdir ~/package + cd ~/build + zip ~/package/artifact.zip ${SubDirectoryLocation:-"*"} -r + echo ::set-output name=artifact::~/package/artifact.zip fi diff --git a/test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 new file mode 100644 index 0000000..a111eea --- /dev/null +++ b/test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 @@ -0,0 +1,3 @@ +source_md5="0167658bc4406f0d0fe437e0197c415a" +dest_md5="64b0613b3173e1e1c96dd18b6569e62d" + diff --git a/test_project/default_env.tres b/test_project/default_env.tres new file mode 100644 index 0000000..20207a4 --- /dev/null +++ b/test_project/default_env.tres @@ -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 ) diff --git a/test_project/empty_scene.tscn b/test_project/empty_scene.tscn new file mode 100644 index 0000000..b171e8d --- /dev/null +++ b/test_project/empty_scene.tscn @@ -0,0 +1,3 @@ +[gd_scene format=2] + +[node name="Node2D" type="Node2D"] diff --git a/test_project/export_presets.cfg b/test_project/export_presets.cfg new file mode 100644 index 0000000..2422425 --- /dev/null +++ b/test_project/export_presets.cfg @@ -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="" +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="" diff --git a/test_project/project.godot b/test_project/project.godot new file mode 100644 index 0000000..f645dad --- /dev/null +++ b/test_project/project.godot @@ -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"