Godot template repository for my programs
| -rw-r--r-- | .gitattributes | 4 | ||||
| -rw-r--r-- | .github/FUNDING.yml | 1 | ||||
| -rw-r--r-- | .github/workflows/export.yml | 98 | ||||
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | Main.tscn | 2 | ||||
| -rw-r--r-- | README.md | 51 | ||||
| l--------- | addons/gdcli | 1 | ||||
| -rw-r--r-- | autoloads/CLI.gd | 16 | ||||
| -rw-r--r-- | export_presets.cfg | 196 | ||||
| -rw-r--r-- | godot.lock | 7 | ||||
| -rw-r--r-- | godot.package | 5 | ||||
| -rwxr-xr-x | install_addons.sh | 2 | ||||
| -rw-r--r-- | project.godot | 11 | ||||
| -rw-r--r-- | submodules/.gdignore | 0 | ||||
| m--------- | submodules/gdcli | 0 |
17 files changed, 230 insertions, 191 deletions
diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index a05dc57..0000000 --- a/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.png filter=lfs diff=lfs merge=lfs -text -*.ogg filter=lfs diff=lfs merge=lfs -text -*.ttf filter=lfs diff=lfs merge=lfs -text -*.svg filter=lfs diff=lfs merge=lfs -text diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..1bfbcab --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +ko_fi: bendn diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml index bde0d3e..360ae61 100644 --- a/.github/workflows/export.yml +++ b/.github/workflows/export.yml @@ -1,71 +1,29 @@ -name: "export" -on: - workflow_dispatch: - push: - paths: - - "**.gd" - - "**.tscn" - - "**.import" +name: "export" # name of the workflow +on: # when it is triggered + workflow_dispatch: # manually or + push: # on a push branches: - - main - -env: - GODOT_VERSION: 3.5 - SUBDIR: /rc6 - RELEASE: rc6 # https://downloads.tuxfamily.org/godotengine/3.5/rc6/ - NAME: ${{ github.event.repository.name }} - -jobs: - export-windows: - name: Windows Export - runs-on: ubuntu-20.04 - steps: - - name: Build - uses: bend-n/godot-actions/.github/actions/export-windows@main - - export-linux: - name: Linux Export - runs-on: ubuntu-20.04 - steps: - - name: Build - uses: bend-n/godot-actions/.github/actions/export-linux@main - - export-web: - name: Web Export - runs-on: ubuntu-20.04 - steps: - - name: Build - uses: bend-n/godot-actions/.github/actions/export-web@main - - export-mac: - name: Mac Export - runs-on: ubuntu-20.04 - steps: - - name: Build - uses: bend-n/godot-actions/.github/actions/export-mac@main - - export-android: - name: Android Export - runs-on: ubuntu-20.04 - steps: - - name: Build - uses: bend-n/godot-actions/.github/actions/export-android@main - with: - android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} - android-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - - push-itch: - needs: - [export-windows, export-linux, export-web, export-mac, export-android] - name: Push to itch.io - runs-on: ubuntu-20.04 - steps: - - name: Check for api key - id: secret - run: echo '::set-output name=secret::${{ secrets.BUTLER_CREDENTIALS }}' - - - name: Push - if: steps.secret.outputs.secret - uses: bend-n/godot-actions/.github/actions/itch-push@main - with: - api-key: ${{ secrets.BUTLER_CREDENTIALS }} + - main # to this branch + paths: # with modifications to these files + - "**.gd" # all gdscript files + - "**.tscn" # scene files + - "**.import" # this means a png changed + - "**.tres" # godot resources + - "**.ttf" # fonts in godot3 dont have their own .import + - ".github/workflows/export.yml" # this workflow + - "export_presets.cfg" # the export template + +jobs: # the things to do + export: # a thing to do + uses: bend-n/godot-actions/.github/workflows/callable-export.yml@main + with: # variables + image: ghcr.io/bend-n/godot-2d:4.0.3 # the container to use (remove the `-2d` if 3d) + export-name: ${{ github.event.repository.name }} # the name of the exec. ($export-name.exe) + platforms: "windows linux web android mac" # space seperated list of platforms to build + project-root-path: "." # the directory that project.godot is in + github-pages: "true" # to deploy html build to github pages or not (anything besides 'true' == false) + itch-path: "${{ github.repository_owner }}/${{ github.event.repository.name }}" # required for itch.io deployment. + secrets: # secrets + butler-api-key: ${{ secrets.BUTLER_CREDENTIALS }} # required for itch.io deployment + android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} # for signing the apk, not required + android-keystore-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} # ditto @@ -1,4 +1,4 @@ -.import/ +.godot/ logs/ *.sh *.py @@ -6,3 +6,4 @@ logs/ .vscode/ exports/ *.x86_64 +addons/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 68b663d..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "gdcli"] - path = submodules/gdcli - url = https://github.com/bend-n/gdcli @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 bendn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. @@ -1,3 +1,3 @@ -[gd_scene format=2] +[gd_scene format=3 uid="uid://dcttfm6g668of"] [node name="Main" type="Node2D"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..be1bf09 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# godot-template + +[](https://godotengine.org "Made with godot") + +Godot template repository for my programs + +--- + +## How to use + +> **Note** +> This template uses the [gpm](https://github.com/godot-package-manager#the-godot-package-manager). + +- Click use this template button +- Clone your new repository +- Run install_addons.sh +- Add your files & change `FUNDING.yml` +- Commit & push + +<details> +<summary>For itch.io depoloyment</summary> +<br> + +Add a secret called `BUTLER_CREDENTIALS` with your [butler api key](https://itch.io/user/settings/api-keys). + +</details> + +<details> +<summary>For android builds</summary> +<br> + +> **Note** +> The keystore user/alias is found automatically. +> If the `ANDROID_KEYSTORE_BASE64` field is not filled, the action will use the android debug keystore. + +Add two secrets: + +- `ANDROID_KEYSTORE_BASE64` +- `ANDROID_KEYSTORE_PASSWORD` + +</details> + +--- + +### CI Availability + +| windows | ios | linux | android | mac | html | | +| :----------------: | :-: | :----------------: | :----------------: | :----------------: | :----------------: | :-----------: | +| :x: | :x: | :x: | :x: | :x: | :heavy_check_mark: | github pages | +| :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | itch.io | +| :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | godot exports | diff --git a/addons/gdcli b/addons/gdcli deleted file mode 120000 index ac119d8..0000000 --- a/addons/gdcli +++ /dev/null @@ -1 +0,0 @@ -../submodules/gdcli/addons/gdcli/
\ No newline at end of file diff --git a/autoloads/CLI.gd b/autoloads/CLI.gd index 095bfd3..0ab5e40 100644 --- a/autoloads/CLI.gd +++ b/autoloads/CLI.gd @@ -1,11 +1,11 @@ extends Node func _ready() -> void: - var p := Parser.new() - p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"})) - var args = p.parse_arguments() - if args == null: - get_tree().quit() - elif args.get("help", false): - print(p.help()) - get_tree().quit()
\ No newline at end of file + var p := Parser.new() + p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"})) + var args = p.parse_arguments(OS.get_cmdline_args() + OS.get_cmdline_user_args()) + if args == null: + get_tree().quit() + elif args.get("help", false): + print(p.help()) + get_tree().quit() diff --git a/export_presets.cfg b/export_presets.cfg index 6980dab..b1492fa 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -3,34 +3,38 @@ name="Windows" platform="Windows Desktop" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" export_path="" -script_export_mode=1 -script_encryption_key="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false [preset.0.options] custom_template/debug="" custom_template/release="" -binary_format/64_bits=true +debug/export_console_script=1 binary_format/embed_pck=true texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false -texture_format/no_bptc_fallbacks=true +binary_format/architecture="x86_64" codesign/enable=false -codesign/identity="" -codesign/password="" codesign/timestamp=true codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" -codesign/custom_options=PoolStringArray( ) +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="" @@ -38,144 +42,103 @@ 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}'" [preset.1] name="Linux" platform="Linux/X11" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" export_path="" -script_export_mode=1 -script_encryption_key="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false [preset.1.options] custom_template/debug="" custom_template/release="" -binary_format/64_bits=true +debug/export_console_script=1 binary_format/embed_pck=true texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false -texture_format/no_bptc_fallbacks=true +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.2] -name="HTML" -platform="HTML5" -runnable=true -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="" -script_export_mode=1 -script_encryption_key="" - -[preset.2.options] - -custom_template/debug="" -custom_template/release="" -variant/export_type=0 -vram_texture_compression/for_desktop=true -vram_texture_compression/for_mobile=false -html/export_icon=true -html/custom_html_shell="res://html/custom.html" -html/head_include="" -html/canvas_resize_policy=2 -html/focus_canvas_on_start=true -html/experimental_virtual_keyboard=true -progressive_web_app/enabled=false -progressive_web_app/offline_page="" -progressive_web_app/display=1 -progressive_web_app/orientation=0 -progressive_web_app/icon_144x144="" -progressive_web_app/icon_180x180="" -progressive_web_app/icon_512x512="" -progressive_web_app/background_color=Color( 0, 0, 0, 1 ) - -[preset.3] - -name="Mac" -platform="Mac OSX" -runnable=true -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="" -script_export_mode=1 -script_encryption_key="" - -[preset.3.options] - -custom_template/debug="" -custom_template/release="" -application/name="Godot Template" -application/info="Godot Template" -application/icon="" -application/identifier="com.godot-template" -application/signature="" -application/app_category="Games" -application/short_version="1.0" -application/version="1.0" -application/copyright="" -display/high_res=false -privacy/camera_usage_description="" -privacy/microphone_usage_description="" -texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false - -[preset.4] - name="Android" platform="Android" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" export_path="" -script_export_mode=1 -script_encryption_key="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false -[preset.4.options] +[preset.2.options] custom_template/debug="" custom_template/release="" -custom_template/use_custom_build=false -custom_template/export_format=0 +gradle_build/use_gradle_build=false +gradle_build/export_format=0 +gradle_build/min_sdk="" +gradle_build/target_sdk="" architectures/armeabi-v7a=true architectures/arm64-v8a=false architectures/x86=false architectures/x86_64=false -keystore/debug="" -keystore/debug_user="" -keystore/debug_password="" -keystore/release="" -keystore/release_user="" -keystore/release_password="" -one_click_deploy/clear_previous_install=false version/code=1 version/name="1.0" -version/min_sdk=19 -version/target_sdk=30 -package/unique_name="org.godotengine.$genname" +package/unique_name="org.bendn.$genname" package/name="" package/signed=true -package/classify_as_game=true +package/app_category=2 package/retain_data_on_uninstall=false package/exclude_from_recents=false launcher_icons/main_192x192="" launcher_icons/adaptive_foreground_432x432="" launcher_icons/adaptive_background_432x432="" -graphics/32_bits_framebuffer=true graphics/opengl_debug=false xr_features/xr_mode=0 xr_features/hand_tracking=0 @@ -191,7 +154,7 @@ command_line/extra_args="" apk_expansion/enable=false apk_expansion/SALT="" apk_expansion/public_key="" -permissions/custom_permissions=PoolStringArray( ) +permissions/custom_permissions=PackedStringArray() permissions/access_checkin_properties=false permissions/access_coarse_location=false permissions/access_fine_location=false @@ -264,6 +227,7 @@ permissions/location_hardware=false permissions/manage_accounts=false permissions/manage_app_tokens=false permissions/manage_documents=false +permissions/manage_external_storage=false permissions/master_clear=false permissions/media_content_control=false permissions/modify_audio_settings=false @@ -337,3 +301,41 @@ permissions/write_sms=false permissions/write_social_stream=false permissions/write_sync_settings=false permissions/write_user_dictionary=false + +[preset.3] + +name="Web" +platform="Web" +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 + +[preset.3.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) diff --git a/godot.lock b/godot.lock new file mode 100644 index 0000000..7a9f8a6 --- /dev/null +++ b/godot.lock @@ -0,0 +1,7 @@ +[ + { + "name": "@bendn/gdcli", + "tarball": "https://registry.npmjs.org/@bendn/gdcli/-/gdcli-2.0.1.tgz", + "version": "2.0.1" + } +]
\ No newline at end of file diff --git a/godot.package b/godot.package new file mode 100644 index 0000000..b445ace --- /dev/null +++ b/godot.package @@ -0,0 +1,5 @@ +{ + "packages": { + "@bendn/gdcli": "^2" + } +} diff --git a/install_addons.sh b/install_addons.sh new file mode 100755 index 0000000..2e86be0 --- /dev/null +++ b/install_addons.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +godot-package-manager update || gpm update || echo "please install the gpm at https://github.com/godot-package-manager/cli/releases/latest" diff --git a/project.godot b/project.godot index 663e841..5d739ae 100644 --- a/project.godot +++ b/project.godot @@ -6,9 +6,9 @@ ; [section] ; section goes between [] ; param=value ; assign values to parameters -config_version=4 +config_version=5 -_global_script_classes=[ { +_global_script_classes=[{ "base": "Reference", "class": "Arg", "language": "GDScript", @@ -18,7 +18,7 @@ _global_script_classes=[ { "class": "Parser", "language": "GDScript", "path": "res://addons/gdcli/Parser.gd" -} ] +}] _global_script_class_icons={ "Arg": "", "Parser": "" @@ -30,6 +30,7 @@ config/name="Godot Template" run/main_scene="res://Main.tscn" config/use_custom_user_dir=true config/custom_user_dir_name="GodotTemplate" +config/features=PackedStringArray("4.1") [autoload] @@ -41,13 +42,11 @@ gdscript/warnings/return_value_discarded=false [display] +window/stretch/mode="2d" window/size/width=320 window/size/height=180 window/size/test_width=1280 window/size/test_height=720 -window/dpi/allow_hidpi=true -window/stretch/mode="2d" -window/stretch/aspect="keep" [logging] diff --git a/submodules/.gdignore b/submodules/.gdignore deleted file mode 100644 index e69de29..0000000 --- a/submodules/.gdignore +++ /dev/null diff --git a/submodules/gdcli b/submodules/gdcli deleted file mode 160000 -Subproject 7f582e8d3a3328023b6d0743597e6e2d09a02a4 |