├── html
├── .gdignore
└── custom.html
├── .github
├── FUNDING.yml
└── workflows
│ └── export.yml
├── godot.package
├── Main.tscn
├── .gitignore
├── godot.lock
├── install_addons.sh
├── autoloads
└── CLI.gd
├── LICENSE
├── project.godot
├── README.md
└── export_presets.cfg
/html/.gdignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: bendn
2 |
--------------------------------------------------------------------------------
/godot.package:
--------------------------------------------------------------------------------
1 | {
2 | "packages": {
3 | "@bendn/gdcli": "^2"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/Main.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene format=3 uid="uid://dcttfm6g668of"]
2 |
3 | [node name="Main" type="Node2D"]
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .godot/
2 | logs/
3 | *.sh
4 | *.py
5 | *.pgn
6 | .vscode/
7 | exports/
8 | *.x86_64
9 | addons/
10 |
--------------------------------------------------------------------------------
/godot.lock:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "@bendn/gdcli",
4 | "tarball": "https://registry.npmjs.org/@bendn/gdcli/-/gdcli-2.0.1.tgz",
5 | "version": "2.0.1"
6 | }
7 | ]
--------------------------------------------------------------------------------
/install_addons.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | godot-package-manager update || gpm update || echo "please install the gpm at https://github.com/godot-package-manager/cli/releases/latest"
3 |
--------------------------------------------------------------------------------
/autoloads/CLI.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 |
3 | func _ready() -> void:
4 | var p := Parser.new()
5 | p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"}))
6 | var args = p.parse_arguments(OS.get_cmdline_args() + OS.get_cmdline_user_args())
7 | if args == null:
8 | get_tree().quit()
9 | elif args.get("help", false):
10 | print(p.help())
11 | get_tree().quit()
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 bendn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/project.godot:
--------------------------------------------------------------------------------
1 | ; Engine configuration file.
2 | ; It's best edited using the editor UI and not directly,
3 | ; since the parameters that go here are not all obvious.
4 | ;
5 | ; Format:
6 | ; [section] ; section goes between []
7 | ; param=value ; assign values to parameters
8 |
9 | config_version=5
10 |
11 | _global_script_classes=[{
12 | "base": "Reference",
13 | "class": "Arg",
14 | "language": "GDScript",
15 | "path": "res://addons/gdcli/Arg.gd"
16 | }, {
17 | "base": "Reference",
18 | "class": "Parser",
19 | "language": "GDScript",
20 | "path": "res://addons/gdcli/Parser.gd"
21 | }]
22 | _global_script_class_icons={
23 | "Arg": "",
24 | "Parser": ""
25 | }
26 |
27 | [application]
28 |
29 | config/name="Godot Template"
30 | run/main_scene="res://Main.tscn"
31 | config/use_custom_user_dir=true
32 | config/custom_user_dir_name="GodotTemplate"
33 | config/features=PackedStringArray("4.1")
34 |
35 | [autoload]
36 |
37 | CLI="*res://autoloads/CLI.gd"
38 |
39 | [debug]
40 |
41 | gdscript/warnings/return_value_discarded=false
42 |
43 | [display]
44 |
45 | window/stretch/mode="2d"
46 | window/size/width=320
47 | window/size/height=180
48 | window/size/test_width=1280
49 | window/size/test_height=720
50 |
51 | [logging]
52 |
53 | file_logging/enable_file_logging=true
54 |
55 | [rendering]
56 |
57 | quality/driver/driver_name="GLES2"
58 | 2d/options/use_nvidia_rect_flicker_workaround=true
59 | quality/intended_usage/framebuffer_allocation=0
60 | quality/intended_usage/framebuffer_allocation.mobile=0
61 | 2d/snapping/use_gpu_pixel_snap=true
62 | vram_compression/import_etc=true
63 |
--------------------------------------------------------------------------------
/.github/workflows/export.yml:
--------------------------------------------------------------------------------
1 | name: "export" # name of the workflow
2 | on: # when it is triggered
3 | workflow_dispatch: # manually or
4 | push: # on a push
5 | branches:
6 | - main # to this branch
7 | paths: # with modifications to these files
8 | - "**.gd" # all gdscript files
9 | - "**.tscn" # scene files
10 | - "**.import" # this means a png changed
11 | - "**.tres" # godot resources
12 | - "**.ttf" # fonts in godot3 dont have their own .import
13 | - ".github/workflows/export.yml" # this workflow
14 | - "export_presets.cfg" # the export template
15 |
16 | jobs: # the things to do
17 | export: # a thing to do
18 | uses: bend-n/godot-actions/.github/workflows/callable-export.yml@main
19 | with: # variables
20 | image: ghcr.io/bend-n/godot-2d:4.0.3 # the container to use (remove the `-2d` if 3d)
21 | export-name: ${{ github.event.repository.name }} # the name of the exec. ($export-name.exe)
22 | platforms: "windows linux web android mac" # space seperated list of platforms to build
23 | project-root-path: "." # the directory that project.godot is in
24 | github-pages: "true" # to deploy html build to github pages or not (anything besides 'true' == false)
25 | itch-path: "${{ github.repository_owner }}/${{ github.event.repository.name }}" # required for itch.io deployment.
26 | secrets: # secrets
27 | butler-api-key: ${{ secrets.BUTLER_CREDENTIALS }} # required for itch.io deployment
28 | android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} # for signing the apk, not required
29 | android-keystore-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} # ditto
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # godot-template
2 |
3 | [](https://godotengine.org "Made with godot")
4 |
5 | Godot template repository for my programs
6 |
7 | ---
8 |
9 | ## How to use
10 |
11 | > **Note**
12 | > This template uses the [gpm](https://github.com/godot-package-manager#the-godot-package-manager).
13 |
14 | - Click use this template button
15 | - Clone your new repository
16 | - Run install_addons.sh
17 | - Add your files & change `FUNDING.yml`
18 | - Commit & push
19 |
20 |
21 | For itch.io depoloyment
22 |
23 |
24 | Add a secret called `BUTLER_CREDENTIALS` with your [butler api key](https://itch.io/user/settings/api-keys).
25 |
26 |
27 |
28 |
29 | For android builds
30 |
31 |
32 | > **Note**
33 | > The keystore user/alias is found automatically.
34 | > If the `ANDROID_KEYSTORE_BASE64` field is not filled, the action will use the android debug keystore.
35 |
36 | Add two secrets:
37 |
38 | - `ANDROID_KEYSTORE_BASE64`
39 | - `ANDROID_KEYSTORE_PASSWORD`
40 |
41 |
42 |
43 | ---
44 |
45 | ### CI Availability
46 |
47 | | windows | ios | linux | android | mac | html | |
48 | | :----------------: | :-: | :----------------: | :----------------: | :----------------: | :----------------: | :-----------: |
49 | | :x: | :x: | :x: | :x: | :x: | :heavy_check_mark: | github pages |
50 | | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | itch.io |
51 | | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | godot exports |
52 |
--------------------------------------------------------------------------------
/html/custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $GODOT_PROJECT_NAME
7 |
130 | $GODOT_HEAD_INCLUDE
131 |
132 |
133 |
137 |
138 |
145 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
279 |
280 |
281 |
--------------------------------------------------------------------------------
/export_presets.cfg:
--------------------------------------------------------------------------------
1 | [preset.0]
2 |
3 | name="Windows"
4 | platform="Windows Desktop"
5 | runnable=true
6 | dedicated_server=false
7 | custom_features=""
8 | export_filter="all_resources"
9 | include_filter=""
10 | exclude_filter=""
11 | export_path=""
12 | encryption_include_filters=""
13 | encryption_exclude_filters=""
14 | encrypt_pck=false
15 | encrypt_directory=false
16 |
17 | [preset.0.options]
18 |
19 | custom_template/debug=""
20 | custom_template/release=""
21 | debug/export_console_script=1
22 | binary_format/embed_pck=true
23 | texture_format/bptc=false
24 | texture_format/s3tc=true
25 | texture_format/etc=false
26 | texture_format/etc2=false
27 | binary_format/architecture="x86_64"
28 | codesign/enable=false
29 | codesign/timestamp=true
30 | codesign/timestamp_server_url=""
31 | codesign/digest_algorithm=1
32 | codesign/description=""
33 | codesign/custom_options=PackedStringArray()
34 | application/modify_resources=true
35 | application/icon=""
36 | application/console_wrapper_icon=""
37 | application/icon_interpolation=4
38 | application/file_version=""
39 | application/product_version=""
40 | application/company_name=""
41 | application/product_name=""
42 | application/file_description=""
43 | application/copyright=""
44 | application/trademarks=""
45 | ssh_remote_deploy/enabled=false
46 | ssh_remote_deploy/host="user@host_ip"
47 | ssh_remote_deploy/port="22"
48 | ssh_remote_deploy/extra_args_ssh=""
49 | ssh_remote_deploy/extra_args_scp=""
50 | ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
51 | $action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
52 | $trigger = New-ScheduledTaskTrigger -Once -At 00:00
53 | $settings = New-ScheduledTaskSettingsSet
54 | $task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
55 | Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
56 | Start-ScheduledTask -TaskName godot_remote_debug
57 | while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
58 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
59 | ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
60 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
61 | Remove-Item -Recurse -Force '{temp_dir}'"
62 |
63 | [preset.1]
64 |
65 | name="Linux"
66 | platform="Linux/X11"
67 | runnable=true
68 | dedicated_server=false
69 | custom_features=""
70 | export_filter="all_resources"
71 | include_filter=""
72 | exclude_filter=""
73 | export_path=""
74 | encryption_include_filters=""
75 | encryption_exclude_filters=""
76 | encrypt_pck=false
77 | encrypt_directory=false
78 |
79 | [preset.1.options]
80 |
81 | custom_template/debug=""
82 | custom_template/release=""
83 | debug/export_console_script=1
84 | binary_format/embed_pck=true
85 | texture_format/bptc=false
86 | texture_format/s3tc=true
87 | texture_format/etc=false
88 | texture_format/etc2=false
89 | binary_format/architecture="x86_64"
90 | ssh_remote_deploy/enabled=false
91 | ssh_remote_deploy/host="user@host_ip"
92 | ssh_remote_deploy/port="22"
93 | ssh_remote_deploy/extra_args_ssh=""
94 | ssh_remote_deploy/extra_args_scp=""
95 | ssh_remote_deploy/run_script="#!/usr/bin/env bash
96 | export DISPLAY=:0
97 | unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
98 | \"{temp_dir}/{exe_name}\" {cmd_args}"
99 | ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
100 | kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
101 | rm -rf \"{temp_dir}\""
102 |
103 | [preset.2]
104 |
105 | name="Android"
106 | platform="Android"
107 | runnable=true
108 | dedicated_server=false
109 | custom_features=""
110 | export_filter="all_resources"
111 | include_filter=""
112 | exclude_filter=""
113 | export_path=""
114 | encryption_include_filters=""
115 | encryption_exclude_filters=""
116 | encrypt_pck=false
117 | encrypt_directory=false
118 |
119 | [preset.2.options]
120 |
121 | custom_template/debug=""
122 | custom_template/release=""
123 | gradle_build/use_gradle_build=false
124 | gradle_build/export_format=0
125 | gradle_build/min_sdk=""
126 | gradle_build/target_sdk=""
127 | architectures/armeabi-v7a=true
128 | architectures/arm64-v8a=false
129 | architectures/x86=false
130 | architectures/x86_64=false
131 | version/code=1
132 | version/name="1.0"
133 | package/unique_name="org.bendn.$genname"
134 | package/name=""
135 | package/signed=true
136 | package/app_category=2
137 | package/retain_data_on_uninstall=false
138 | package/exclude_from_recents=false
139 | launcher_icons/main_192x192=""
140 | launcher_icons/adaptive_foreground_432x432=""
141 | launcher_icons/adaptive_background_432x432=""
142 | graphics/opengl_debug=false
143 | xr_features/xr_mode=0
144 | xr_features/hand_tracking=0
145 | xr_features/hand_tracking_frequency=0
146 | xr_features/passthrough=0
147 | screen/immersive_mode=true
148 | screen/support_small=true
149 | screen/support_normal=true
150 | screen/support_large=true
151 | screen/support_xlarge=true
152 | user_data_backup/allow=false
153 | command_line/extra_args=""
154 | apk_expansion/enable=false
155 | apk_expansion/SALT=""
156 | apk_expansion/public_key=""
157 | permissions/custom_permissions=PackedStringArray()
158 | permissions/access_checkin_properties=false
159 | permissions/access_coarse_location=false
160 | permissions/access_fine_location=false
161 | permissions/access_location_extra_commands=false
162 | permissions/access_mock_location=false
163 | permissions/access_network_state=false
164 | permissions/access_surface_flinger=false
165 | permissions/access_wifi_state=false
166 | permissions/account_manager=false
167 | permissions/add_voicemail=false
168 | permissions/authenticate_accounts=false
169 | permissions/battery_stats=false
170 | permissions/bind_accessibility_service=false
171 | permissions/bind_appwidget=false
172 | permissions/bind_device_admin=false
173 | permissions/bind_input_method=false
174 | permissions/bind_nfc_service=false
175 | permissions/bind_notification_listener_service=false
176 | permissions/bind_print_service=false
177 | permissions/bind_remoteviews=false
178 | permissions/bind_text_service=false
179 | permissions/bind_vpn_service=false
180 | permissions/bind_wallpaper=false
181 | permissions/bluetooth=false
182 | permissions/bluetooth_admin=false
183 | permissions/bluetooth_privileged=false
184 | permissions/brick=false
185 | permissions/broadcast_package_removed=false
186 | permissions/broadcast_sms=false
187 | permissions/broadcast_sticky=false
188 | permissions/broadcast_wap_push=false
189 | permissions/call_phone=false
190 | permissions/call_privileged=false
191 | permissions/camera=false
192 | permissions/capture_audio_output=false
193 | permissions/capture_secure_video_output=false
194 | permissions/capture_video_output=false
195 | permissions/change_component_enabled_state=false
196 | permissions/change_configuration=false
197 | permissions/change_network_state=false
198 | permissions/change_wifi_multicast_state=false
199 | permissions/change_wifi_state=false
200 | permissions/clear_app_cache=false
201 | permissions/clear_app_user_data=false
202 | permissions/control_location_updates=false
203 | permissions/delete_cache_files=false
204 | permissions/delete_packages=false
205 | permissions/device_power=false
206 | permissions/diagnostic=false
207 | permissions/disable_keyguard=false
208 | permissions/dump=false
209 | permissions/expand_status_bar=false
210 | permissions/factory_test=false
211 | permissions/flashlight=false
212 | permissions/force_back=false
213 | permissions/get_accounts=false
214 | permissions/get_package_size=false
215 | permissions/get_tasks=false
216 | permissions/get_top_activity_info=false
217 | permissions/global_search=false
218 | permissions/hardware_test=false
219 | permissions/inject_events=false
220 | permissions/install_location_provider=false
221 | permissions/install_packages=false
222 | permissions/install_shortcut=false
223 | permissions/internal_system_window=false
224 | permissions/internet=false
225 | permissions/kill_background_processes=false
226 | permissions/location_hardware=false
227 | permissions/manage_accounts=false
228 | permissions/manage_app_tokens=false
229 | permissions/manage_documents=false
230 | permissions/manage_external_storage=false
231 | permissions/master_clear=false
232 | permissions/media_content_control=false
233 | permissions/modify_audio_settings=false
234 | permissions/modify_phone_state=false
235 | permissions/mount_format_filesystems=false
236 | permissions/mount_unmount_filesystems=false
237 | permissions/nfc=false
238 | permissions/persistent_activity=false
239 | permissions/process_outgoing_calls=false
240 | permissions/read_calendar=false
241 | permissions/read_call_log=false
242 | permissions/read_contacts=false
243 | permissions/read_external_storage=false
244 | permissions/read_frame_buffer=false
245 | permissions/read_history_bookmarks=false
246 | permissions/read_input_state=false
247 | permissions/read_logs=false
248 | permissions/read_phone_state=false
249 | permissions/read_profile=false
250 | permissions/read_sms=false
251 | permissions/read_social_stream=false
252 | permissions/read_sync_settings=false
253 | permissions/read_sync_stats=false
254 | permissions/read_user_dictionary=false
255 | permissions/reboot=false
256 | permissions/receive_boot_completed=false
257 | permissions/receive_mms=false
258 | permissions/receive_sms=false
259 | permissions/receive_wap_push=false
260 | permissions/record_audio=false
261 | permissions/reorder_tasks=false
262 | permissions/restart_packages=false
263 | permissions/send_respond_via_message=false
264 | permissions/send_sms=false
265 | permissions/set_activity_watcher=false
266 | permissions/set_alarm=false
267 | permissions/set_always_finish=false
268 | permissions/set_animation_scale=false
269 | permissions/set_debug_app=false
270 | permissions/set_orientation=false
271 | permissions/set_pointer_speed=false
272 | permissions/set_preferred_applications=false
273 | permissions/set_process_limit=false
274 | permissions/set_time=false
275 | permissions/set_time_zone=false
276 | permissions/set_wallpaper=false
277 | permissions/set_wallpaper_hints=false
278 | permissions/signal_persistent_processes=false
279 | permissions/status_bar=false
280 | permissions/subscribed_feeds_read=false
281 | permissions/subscribed_feeds_write=false
282 | permissions/system_alert_window=false
283 | permissions/transmit_ir=false
284 | permissions/uninstall_shortcut=false
285 | permissions/update_device_stats=false
286 | permissions/use_credentials=false
287 | permissions/use_sip=false
288 | permissions/vibrate=false
289 | permissions/wake_lock=false
290 | permissions/write_apn_settings=false
291 | permissions/write_calendar=false
292 | permissions/write_call_log=false
293 | permissions/write_contacts=false
294 | permissions/write_external_storage=false
295 | permissions/write_gservices=false
296 | permissions/write_history_bookmarks=false
297 | permissions/write_profile=false
298 | permissions/write_secure_settings=false
299 | permissions/write_settings=false
300 | permissions/write_sms=false
301 | permissions/write_social_stream=false
302 | permissions/write_sync_settings=false
303 | permissions/write_user_dictionary=false
304 |
305 | [preset.3]
306 |
307 | name="Web"
308 | platform="Web"
309 | runnable=true
310 | dedicated_server=false
311 | custom_features=""
312 | export_filter="all_resources"
313 | include_filter=""
314 | exclude_filter=""
315 | export_path=""
316 | encryption_include_filters=""
317 | encryption_exclude_filters=""
318 | encrypt_pck=false
319 | encrypt_directory=false
320 |
321 | [preset.3.options]
322 |
323 | custom_template/debug=""
324 | custom_template/release=""
325 | variant/extensions_support=false
326 | vram_texture_compression/for_desktop=true
327 | vram_texture_compression/for_mobile=false
328 | html/export_icon=true
329 | html/custom_html_shell=""
330 | html/head_include=""
331 | html/canvas_resize_policy=2
332 | html/focus_canvas_on_start=true
333 | html/experimental_virtual_keyboard=false
334 | progressive_web_app/enabled=false
335 | progressive_web_app/offline_page=""
336 | progressive_web_app/display=1
337 | progressive_web_app/orientation=0
338 | progressive_web_app/icon_144x144=""
339 | progressive_web_app/icon_180x180=""
340 | progressive_web_app/icon_512x512=""
341 | progressive_web_app/background_color=Color(0, 0, 0, 1)
342 |
--------------------------------------------------------------------------------