From f362e14dc5d8290ac81ee3ed7c799242dd3215af Mon Sep 17 00:00:00 2001 From: Bioblaze Payne Date: Mon, 10 Jul 2023 12:31:28 -0700 Subject: [PATCH] Update entrypoint.sh (#22) * Update entrypoint.sh * Update entrypoint.sh * modified to support proper requirements for godot-ci project * Modified for testing * added a copy of the action for testing * test * added ls * added ls debug * modified ls debug * Last push fixes the issue with not building, both build tests work * Modified it so we showcase Support for Testing 3.x and 4.x Godot Projects * Modified the Github Action names to properly reflect the tests --- .../{test_action.yml => test_action_3.x.yml} | 4 +- .github/workflows/test_action_4.x.yml | 18 +++ ...n.png-487276ed1e3a0c39cad0279d744ee560.md5 | 0 .../default_env.tres | 0 .../empty_scene.tscn | 0 .../export_presets.cfg | 0 .../project.godot | 0 4.x_test_project/.gitattributes | 2 + 4.x_test_project/.gitignore | 2 + 4.x_test_project/export_presets.cfg | 106 ++++++++++++++++++ 4.x_test_project/icon.svg | 1 + 4.x_test_project/icon.svg.import | 37 ++++++ 4.x_test_project/project.godot | 15 +++ entrypoint.sh | 8 +- 14 files changed, 188 insertions(+), 5 deletions(-) rename .github/workflows/{test_action.yml => test_action_3.x.yml} (81%) create mode 100644 .github/workflows/test_action_4.x.yml rename {test_project => 3.x_test_project}/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 (100%) rename {test_project => 3.x_test_project}/default_env.tres (100%) rename {test_project => 3.x_test_project}/empty_scene.tscn (100%) rename {test_project => 3.x_test_project}/export_presets.cfg (100%) rename {test_project => 3.x_test_project}/project.godot (100%) create mode 100644 4.x_test_project/.gitattributes create mode 100644 4.x_test_project/.gitignore create mode 100644 4.x_test_project/export_presets.cfg create mode 100644 4.x_test_project/icon.svg create mode 100644 4.x_test_project/icon.svg.import create mode 100644 4.x_test_project/project.godot diff --git a/.github/workflows/test_action.yml b/.github/workflows/test_action_3.x.yml similarity index 81% rename from .github/workflows/test_action.yml rename to .github/workflows/test_action_3.x.yml index 3f14baf..5d8aa9e 100644 --- a/.github/workflows/test_action.yml +++ b/.github/workflows/test_action_3.x.yml @@ -1,4 +1,4 @@ -name: Test Action +name: Test Action 3.x on: [push, pull_request] @@ -13,5 +13,5 @@ jobs: with: name: test_project preset: linux - projectDir: test_project + projectDir: 3.x_test_project package: 'true' \ No newline at end of file diff --git a/.github/workflows/test_action_4.x.yml b/.github/workflows/test_action_4.x.yml new file mode 100644 index 0000000..6e685cd --- /dev/null +++ b/.github/workflows/test_action_4.x.yml @@ -0,0 +1,18 @@ +name: Test Action 4.x +on: + push: + branches: [ 'master', 'main', 'prod', 'production' ] + +jobs: + TestAction: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Run Action + uses: ./ + with: + name: test_project + preset: linux + projectDir: 4.x_test_project + package: 'true' \ No newline at end of file diff --git a/test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/3.x_test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 similarity index 100% rename from test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 rename to 3.x_test_project/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 diff --git a/test_project/default_env.tres b/3.x_test_project/default_env.tres similarity index 100% rename from test_project/default_env.tres rename to 3.x_test_project/default_env.tres diff --git a/test_project/empty_scene.tscn b/3.x_test_project/empty_scene.tscn similarity index 100% rename from test_project/empty_scene.tscn rename to 3.x_test_project/empty_scene.tscn diff --git a/test_project/export_presets.cfg b/3.x_test_project/export_presets.cfg similarity index 100% rename from test_project/export_presets.cfg rename to 3.x_test_project/export_presets.cfg diff --git a/test_project/project.godot b/3.x_test_project/project.godot similarity index 100% rename from test_project/project.godot rename to 3.x_test_project/project.godot diff --git a/4.x_test_project/.gitattributes b/4.x_test_project/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/4.x_test_project/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/4.x_test_project/.gitignore b/4.x_test_project/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/4.x_test_project/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/4.x_test_project/export_presets.cfg b/4.x_test_project/export_presets.cfg new file mode 100644 index 0000000..d503ea3 --- /dev/null +++ b/4.x_test_project/export_presets.cfg @@ -0,0 +1,106 @@ +[preset.0] + +name="linux" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_script=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.1] + +name="windows" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_encryption_key="" + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_script=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/4.x_test_project/icon.svg b/4.x_test_project/icon.svg new file mode 100644 index 0000000..adc26df --- /dev/null +++ b/4.x_test_project/icon.svg @@ -0,0 +1 @@ + diff --git a/4.x_test_project/icon.svg.import b/4.x_test_project/icon.svg.import new file mode 100644 index 0000000..58c0fb1 --- /dev/null +++ b/4.x_test_project/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bektdji2blm55" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/4.x_test_project/project.godot b/4.x_test_project/project.godot new file mode 100644 index 0000000..1d26b4f --- /dev/null +++ b/4.x_test_project/project.godot @@ -0,0 +1,15 @@ +; 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=5 + +[application] + +config/name="Test Project" +config/features=PackedStringArray("4.0", "Forward Plus") +config/icon="res://icon.svg" diff --git a/entrypoint.sh b/entrypoint.sh index 54896d5..27b90c3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,14 +2,16 @@ set -e # Move godot templates already installed from the docker image to home -mv -n /root/.local ~ +mkdir -v -p ~/.local/share/godot/export_templates +cp -a /root/.local/share/godot/templates/. ~/.local/share/godot/export_templates/ + if [ "$3" != "" ] then SubDirectoryLocation="$3/" fi -mode="export" +mode="export-release" if [ "$6" = "true" ] then echo "Exporting in debug mode!" @@ -20,7 +22,7 @@ fi echo "Building $1 for $2" mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""} cd "$GITHUB_WORKSPACE/$5" -godot --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1 +godot --headless --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1 echo "Build Done" echo ::set-output name=build::build/${SubDirectoryLocation:-""}