Skip to content

Commit

Permalink
updated updater
Browse files Browse the repository at this point in the history
added connector for telemetry
  • Loading branch information
DmitriySalnikov committed Dec 31, 2023
1 parent f54c603 commit 73e25c2
Show file tree
Hide file tree
Showing 18 changed files with 480 additions and 405 deletions.
24 changes: 23 additions & 1 deletion .github/actions/compile_gdextension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ inputs:
use_cache:
description: Use cache
default: "true"
token:
description: Secrets token
telemetry_version:
description: Telemetry version
default: 2fcd3ec9e528d1cd26978d0d27e9c6a3b2006270
runs:
using: composite
steps:
Expand All @@ -38,6 +43,17 @@ runs:
run: |
echo "sha=$(git rev-parse @:./godot-cpp)" >> $GITHUB_OUTPUT
- name: Checkout telemetry repo
uses: actions/checkout@v4
id: checkout_tele_repo
if: ${{env.PRODUCTION_BUILD == 'true' && inputs.target == 'editor'}}
continue-on-error: true
with:
repository: ${{github.repository_owner}}/my_telemetry_modules
token: ${{inputs.token}}
ref: ${{inputs.telemetry_version}}
path: src/editor/my_telemetry_modules

- name: Restore .scons_cache directory
if: inputs.use_cache != 'false'
id: restore_scons_cache
Expand Down Expand Up @@ -83,7 +99,13 @@ runs:
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
cd ..
scons platform=${{inputs.platform}} arch=${{inputs.arch}} target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} ${{inputs.additional}}
telemetry_args=""
if [ "${{env.PRODUCTION_BUILD}}" == "true" ] && [ "${{inputs.target}}" == "editor" ] && [ "${{steps.checkout_tele_repo.conclusion}}" == "success" ]; then
telemetry_args="telemetry_enabled=yes"
fi
scons platform=${{inputs.platform}} arch=${{inputs.arch}} target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} ${{inputs.additional}} $telemetry_args
if [ "${{inputs.target}}" == "template_release" ] && [ "${{inputs.additional_enabled_dd3d}}" == "true" ]; then
scons platform=${{inputs.platform}} arch=${{inputs.arch}} target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} force_enabled_dd3d=yes ${{inputs.additional}}
fi
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/gdextension_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
paths: [src/**, .github/**, "!.github/**/util_*", "patches/**", lib_utils.py, SConstruct]
workflow_dispatch:
inputs:
production_build:
description: Production build
default: true
type: boolean
use_cache:
description: Use Cache
default: true
Expand All @@ -22,6 +26,7 @@ permissions:
env:
SCONS_CACHE: ${{github.workspace}}/.scons-cache/
USE_CACHE: ${{!format('{0}', inputs.use_cache) && 'true' || format('{0}', inputs.use_cache)}} # Default true
PRODUCTION_BUILD: ${{!format('{0}', inputs.production_build) && 'false' || format('{0}', inputs.production_build)}} # Default false
OUTPUT_LIBS_PATH: bin
FORCE_DISABLE_UNITY: yes
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -54,6 +59,7 @@ jobs:
additional: lto=yes
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{env.USE_CACHE}}
token: ${{secrets.TELEMETRY_TOKEN}}

# ============================================

Expand Down Expand Up @@ -84,6 +90,7 @@ jobs:
additional: lto=yes
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{env.USE_CACHE}}
token: ${{secrets.TELEMETRY_TOKEN}}

# ============================================

Expand Down Expand Up @@ -114,6 +121,7 @@ jobs:
additional: lto=yes macos_deployment_target=10.14
output_libs_path: ${{env.OUTPUT_LIBS_PATH}}
use_cache: ${{env.USE_CACHE}}
token: ${{secrets.TELEMETRY_TOKEN}}

# ============================================

Expand Down Expand Up @@ -247,6 +255,6 @@ jobs:
- name: Upload GDExtension
uses: actions/upload-artifact@v4
with:
name: .gdextension_libs
name: ${{env.PRODUCTION_BUILD == 'true' && '.gdextension_libs_production' || '.gdextension_libs'}}
retention-days: 7
path: extracted_files/*
7 changes: 4 additions & 3 deletions .github/workflows/util_update_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ jobs:
lfs: true

- name: Download GDExtension Binaries
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v3
with:
workflow: gdextension_build.yml
branch: ${{github.ref_name}}
name: .gdextension_libs
name: .gdextension_libs_production
path: extracted_files/
event: workflow_dispatch

- name: Replace with new files
shell: bash
Expand All @@ -41,7 +42,7 @@ jobs:
git config --global user.email 'github-actions-auto-updater[bot]@users.noreply.github.com'
git diff
git add -A
git commit --allow-empty -am "[CI] ↗️ Updated Binaries: ${{github.sha}}"
git commit -am "[CI] ↗️ Updated Binaries: ${{github.sha}}"
git push
echo "## Changed files:" >> $GITHUB_STEP_SUMMARY
Expand Down
5 changes: 4 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
],
"defines": [
"DEBUG_ENABLED",
"DEV_ENABLED",
"UNICODE",
"_UNICODE",
"GDEXTENSION_LIBRARY",
"NOMINMAX",
"TYPED_METHOD_BIND",
"HOT_RELOAD_ENABLED"
"HOT_RELOAD_ENABLED",
"TOOLS_ENABLED",
"TELEMETRY_ENABLED"
],
"cStandard": "c17",
"cppStandard": "c++17",
Expand Down
2 changes: 1 addition & 1 deletion addons/debug_draw_3d/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 DmitriySalnikov
Copyright (c) 2024 DmitriySalnikov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
Expand Down
24 changes: 14 additions & 10 deletions examples_dd3d/DebugDrawDemoScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ extends Node3D

var button_presses := {}
var frame_rendered := false
var phys_frame_called := false
var physics_tick_processed := false

var timer_1 := 0.0
var timer_2 := 0.0
var timer_3 := 0.0
var timer_text := 0.0

var is_4_2_and_higher = Engine.get_version_info()["major"] >= 4 && Engine.get_version_info()["minor"] >= 2


func _process(delta) -> void:
phys_frame_called = false
physics_tick_processed = false
if !update_in_physics:
main_update(delta)
_update_timers(delta)
Expand All @@ -55,8 +57,8 @@ func _process(delta) -> void:
## there is an additional check to ensure that a new frame has been drawn before updating the data.
func _physics_process(delta: float) -> void:
if update_in_physics:
if !phys_frame_called:
phys_frame_called = true
if !physics_tick_processed:
physics_tick_processed = true
main_update(delta)
_update_timers(delta)

Expand Down Expand Up @@ -386,19 +388,21 @@ func _more_tests():
var plane = Plane(normal, xf.origin.dot(normal))

var vp: Viewport = get_viewport()
if Engine.is_editor_hint() and Engine.get_singleton(&"EditorInterface").get_editor_viewport_3d(0):
vp = Engine.get_singleton(&"EditorInterface").get_editor_viewport_3d(0)
if is_4_2_and_higher:
if Engine.is_editor_hint() and Engine.get_singleton(&"EditorInterface").get_editor_viewport_3d(0):
vp = Engine.get_singleton(&"EditorInterface").get_editor_viewport_3d(0)

var cam = vp.get_camera_3d()
if cam:
var dir = vp.get_camera_3d().project_ray_normal(vp.get_mouse_position())
var intersect = plane.intersects_ray(cam.global_position, dir)

DebugDraw3D.draw_plane(plane, Color.CORAL * Color(1,1,1, 0.4), pl_node.global_position)
if intersect and intersect.distance_to(pl_node.global_position) < _s11.get_plane_size() * 0.5:
# Need to test different colors on both sides of the plane
var col = Color.FIREBRICK if plane.is_point_over(cam.global_position) else Color.AQUAMARINE
DebugDraw3D.draw_sphere(intersect, 0.3, col)
if is_4_2_and_higher:
if intersect and intersect.distance_to(pl_node.global_position) < _s11.get_plane_size() * 0.5:
# Need to test different colors on both sides of the plane
var col = Color.FIREBRICK if plane.is_point_over(cam.global_position) else Color.AQUAMARINE
DebugDraw3D.draw_sphere(intersect, 0.3, col)


func _draw_array_of_boxes():
Expand Down
Loading

0 comments on commit 73e25c2

Please sign in to comment.