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, 191 insertions, 230 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a05dc57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +*.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 deleted file mode 100644 index 1bfbcab..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -ko_fi: bendn diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml index 360ae61..bde0d3e 100644 --- a/.github/workflows/export.yml +++ b/.github/workflows/export.yml @@ -1,29 +1,71 @@ -name: "export" # name of the workflow -on: # when it is triggered - workflow_dispatch: # manually or - push: # on a push +name: "export" +on: + workflow_dispatch: + push: + paths: + - "**.gd" + - "**.tscn" + - "**.import" branches: - - 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 + - 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 }} @@ -1,4 +1,4 @@ -.godot/ +.import/ logs/ *.sh *.py @@ -6,4 +6,3 @@ logs/ .vscode/ exports/ *.x86_64 -addons/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..68b663d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gdcli"] + path = submodules/gdcli + url = https://github.com/bend-n/gdcli diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9a9763e..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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=3 uid="uid://dcttfm6g668of"] +[gd_scene format=2] [node name="Main" type="Node2D"] diff --git a/README.md b/README.md deleted file mode 100644 index be1bf09..0000000 --- a/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# 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 new file mode 120000 index 0000000..ac119d8 --- /dev/null +++ b/addons/gdcli @@ -0,0 +1 @@ +../submodules/gdcli/addons/gdcli/
\ No newline at end of file diff --git a/autoloads/CLI.gd b/autoloads/CLI.gd index 0ab5e40..095bfd3 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(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() + 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 diff --git a/export_presets.cfg b/export_presets.cfg index b1492fa..6980dab 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -3,38 +3,34 @@ 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_export_mode=1 +script_encryption_key="" [preset.0.options] custom_template/debug="" custom_template/release="" -debug/export_console_script=1 +binary_format/64_bits=true binary_format/embed_pck=true texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false -binary_format/architecture="x86_64" +texture_format/no_bptc_fallbacks=true codesign/enable=false +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 +codesign/custom_options=PoolStringArray( ) application/icon="" -application/console_wrapper_icon="" -application/icon_interpolation=4 application/file_version="" application/product_version="" application/company_name="" @@ -42,103 +38,144 @@ 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="" -encryption_include_filters="" -encryption_exclude_filters="" -encrypt_pck=false -encrypt_directory=false +script_export_mode=1 +script_encryption_key="" [preset.1.options] custom_template/debug="" custom_template/release="" -debug/export_console_script=1 +binary_format/64_bits=true binary_format/embed_pck=true texture_format/bptc=false 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}\"" +texture_format/no_bptc_fallbacks=true [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="" -encryption_include_filters="" -encryption_exclude_filters="" -encrypt_pck=false -encrypt_directory=false +script_export_mode=1 +script_encryption_key="" -[preset.2.options] +[preset.4.options] custom_template/debug="" custom_template/release="" -gradle_build/use_gradle_build=false -gradle_build/export_format=0 -gradle_build/min_sdk="" -gradle_build/target_sdk="" +custom_template/use_custom_build=false +custom_template/export_format=0 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" -package/unique_name="org.bendn.$genname" +version/min_sdk=19 +version/target_sdk=30 +package/unique_name="org.godotengine.$genname" package/name="" package/signed=true -package/app_category=2 +package/classify_as_game=true 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 @@ -154,7 +191,7 @@ command_line/extra_args="" apk_expansion/enable=false apk_expansion/SALT="" apk_expansion/public_key="" -permissions/custom_permissions=PackedStringArray() +permissions/custom_permissions=PoolStringArray( ) permissions/access_checkin_properties=false permissions/access_coarse_location=false permissions/access_fine_location=false @@ -227,7 +264,6 @@ 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 @@ -301,41 +337,3 @@ 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 deleted file mode 100644 index 7a9f8a6..0000000 --- a/godot.lock +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "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 deleted file mode 100644 index b445ace..0000000 --- a/godot.package +++ /dev/null @@ -1,5 +0,0 @@ -{ - "packages": { - "@bendn/gdcli": "^2" - } -} diff --git a/install_addons.sh b/install_addons.sh deleted file mode 100755 index 2e86be0..0000000 --- a/install_addons.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 5d739ae..663e841 100644 --- a/project.godot +++ b/project.godot @@ -6,9 +6,9 @@ ; [section] ; section goes between [] ; param=value ; assign values to parameters -config_version=5 +config_version=4 -_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,7 +30,6 @@ 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] @@ -42,11 +41,13 @@ 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 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/submodules/.gdignore diff --git a/submodules/gdcli b/submodules/gdcli new file mode 160000 +Subproject 7f582e8d3a3328023b6d0743597e6e2d09a02a4 |