diff --git a/.github/actions/compile_gdextension/action.yml b/.github/actions/compile_gdextension/action.yml index b121b3f3..5ba6209f 100644 --- a/.github/actions/compile_gdextension/action.yml +++ b/.github/actions/compile_gdextension/action.yml @@ -29,11 +29,9 @@ inputs: use_cache: description: Use cache default: "true" - token: - description: Secrets token telemetry_version: description: Telemetry version - default: b8386398c134f3c7503139e84f952d62207e54ae + default: 42efc0d98c6a0e7a104c5a878005ca07d70ad031 runs: using: composite steps: @@ -49,10 +47,9 @@ runs: if: ${{env.PRODUCTION_BUILD == 'true' && contains(fromJSON('["template_debug", "editor"]'), inputs.target) && contains(fromJSON('["linux", "macos", "windows"]'), inputs.platform)}} continue-on-error: true with: - repository: ${{github.repository_owner}}/my_telemetry_modules - token: ${{inputs.token}} + repository: ${{github.repository_owner}}/dst_modules ref: ${{inputs.telemetry_version}} - path: src/editor/my_telemetry_modules + path: src/editor/dst_modules - name: Restore .scons_cache directory if: inputs.use_cache != 'false' diff --git a/.github/workflows/gdextension_build.yml b/.github/workflows/gdextension_build.yml index 904200e7..ad42f4a4 100644 --- a/.github/workflows/gdextension_build.yml +++ b/.github/workflows/gdextension_build.yml @@ -43,14 +43,19 @@ 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 + ENVIRONMENT_NAME: ${{inputs.production_build == 'true' && 'production' || ''}} OUTPUT_LIBS_PATH: bin FORCE_DISABLE_UNITY: yes - GH_TOKEN: ${{ github.token }} jobs: windows-gdextension: name: 🏁 Windows runs-on: windows-latest + environment: ${{inputs.production_build == true && 'production' || ''}} + env: + TELEMETRY_DD3D_APP_ID: ${{secrets.TELEMETRY_DD3D_APP_ID}} + TELEMETRY_DD3D_HOST: ${{secrets.TELEMETRY_DD3D_HOST}} + TELEMETRY_DST_FILE_KEY: ${{secrets.TELEMETRY_DST_FILE_KEY}} strategy: fail-fast: false @@ -74,13 +79,17 @@ jobs: additional: lto=yes output_libs_path: ${{env.OUTPUT_LIBS_PATH}} use_cache: ${{env.USE_CACHE}} - token: ${{secrets.TELEMETRY_TOKEN}} # ============================================ linux-gdextension: name: 🐧 Linux runs-on: ubuntu-20.04 + environment: ${{inputs.production_build == true && 'production' || ''}} + env: + TELEMETRY_DD3D_APP_ID: ${{secrets.TELEMETRY_DD3D_APP_ID}} + TELEMETRY_DD3D_HOST: ${{secrets.TELEMETRY_DD3D_HOST}} + TELEMETRY_DST_FILE_KEY: ${{secrets.TELEMETRY_DST_FILE_KEY}} strategy: fail-fast: false @@ -104,13 +113,17 @@ jobs: additional: lto=yes output_libs_path: ${{env.OUTPUT_LIBS_PATH}} use_cache: ${{env.USE_CACHE}} - token: ${{secrets.TELEMETRY_TOKEN}} # ============================================ macos-gdextension: name: 🍏 MacOS runs-on: macos-latest + environment: ${{inputs.production_build == true && 'production' || ''}} + env: + TELEMETRY_DD3D_APP_ID: ${{secrets.TELEMETRY_DD3D_APP_ID}} + TELEMETRY_DD3D_HOST: ${{secrets.TELEMETRY_DD3D_HOST}} + TELEMETRY_DST_FILE_KEY: ${{secrets.TELEMETRY_DST_FILE_KEY}} strategy: fail-fast: false @@ -134,7 +147,6 @@ 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}} # ============================================ @@ -164,7 +176,6 @@ jobs: additional: lto=yes output_libs_path: ${{env.OUTPUT_LIBS_PATH}} use_cache: ${{env.USE_CACHE}} - token: ${{secrets.TELEMETRY_TOKEN}} # ============================================ @@ -284,6 +295,11 @@ jobs: double-debug-gdextension: name: "2️⃣ Double: ${{matrix.runner-os}}, Platform-${{matrix.platform}}" runs-on: ${{matrix.runner-os}} + environment: ${{inputs.production_build == true && 'production' || ''}} + env: + TELEMETRY_DD3D_APP_ID: ${{secrets.TELEMETRY_DD3D_APP_ID}} + TELEMETRY_DD3D_HOST: ${{secrets.TELEMETRY_DD3D_HOST}} + TELEMETRY_DST_FILE_KEY: ${{secrets.TELEMETRY_DST_FILE_KEY}} strategy: fail-fast: false @@ -317,7 +333,6 @@ jobs: additional: lto=yes precision=double fix_precision_enabled=yes shader_world_coords_enabled=no output_libs_path: ${{env.OUTPUT_LIBS_PATH}} use_cache: ${{env.USE_CACHE}} - token: ${{secrets.TELEMETRY_TOKEN}} - name: Compile GDExtension target=template_release uses: ./.github/actions/compile_gdextension @@ -329,7 +344,6 @@ jobs: additional: lto=yes precision=double fix_precision_enabled=yes shader_world_coords_enabled=no output_libs_path: ${{env.OUTPUT_LIBS_PATH}} use_cache: ${{env.USE_CACHE}} - token: ${{secrets.TELEMETRY_TOKEN}} # ============================================ diff --git a/.gitignore b/.gitignore index 1897f0e2..1ab84e0e 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,7 @@ bin/ libs/ cmake_build_out/* src/gen/* -src/editor/my_telemetry_modules +src/editor/dst_modules addons/debug_draw_3d/gen/ clang_rt.asan_* docs/images/classes/temp/ diff --git a/SConstruct b/SConstruct index 81c6fca5..d5c0fef9 100644 --- a/SConstruct +++ b/SConstruct @@ -64,9 +64,17 @@ def setup_defines_and_flags(env: SConsEnvironment, src_out): env.Append(CPPDEFINES=["DISABLE_DEBUG_RENDERING"]) if env["telemetry_enabled"]: - tele_src = "editor/my_telemetry_modules/GDExtension/usage_time_reporter.cpp" + tele_src = "editor/dst_modules/GDExtension/usage_time_reporter.cpp" if os.path.exists(os.path.join(src_folder, tele_src)): - env.Append(CPPDEFINES=["TELEMETRY_ENABLED", "TELEMETRY_PROJECT_DD3D"]) + env.Append( + CPPDEFINES=[ + "TELEMETRY_ENABLED", + "UsageTimeReporterGodotObj=_UsageTimeReporterGodotObjDD3D", + 'TELEMETRY_DST_FILE_KEY=\\"' + os.environ.get("TELEMETRY_DST_FILE_KEY", '\\"') + '\\"', + 'TELEMETRY_APP_ID=\\"' + os.environ.get("TELEMETRY_DD3D_APP_ID", '\\"') + '\\"', + 'TELEMETRY_HOST=\\"' + os.environ.get("TELEMETRY_DD3D_HOST", '\\"') + '\\"', + ] + ) src_out.append(tele_src) print("Compiling with telemetry support!") else: diff --git a/src/register_types.cpp b/src/register_types.cpp index a9210421..998d14fb 100644 --- a/src/register_types.cpp +++ b/src/register_types.cpp @@ -21,7 +21,7 @@ GODOT_WARNING_DISABLE() GODOT_WARNING_RESTORE() #ifdef TELEMETRY_ENABLED -#include "editor/my_telemetry_modules/GDExtension/usage_time_reporter.h" +#include "editor/dst_modules/GDExtension/usage_time_reporter.h" DEFINE_TELEMETRY_OBJECT_ID(dd3d_usage_obj_id); #endif @@ -77,7 +77,7 @@ void initialize_debug_draw_3d_module(ModuleInitializationLevel p_level) { upd_checker.instantiate(); #ifdef TELEMETRY_ENABLED - INIT_EDITOR_TELEMETRY_OBJECT(dd3d_usage_obj_id, DD3D_VERSION_STR, Utils::root_settings_section); + INIT_EDITOR_TELEMETRY_OBJECT(dd3d_usage_obj_id, "Debug Draw 3D", TELEMETRY_APP_ID, DD3D_VERSION_STR, Utils::root_settings_section, TELEMETRY_HOST, "telemetry_dd3d.json"); #endif } #endif @@ -87,7 +87,6 @@ void initialize_debug_draw_3d_module(ModuleInitializationLevel p_level) { /** GDExtension Uninitialize **/ void uninitialize_debug_draw_3d_module(ModuleInitializationLevel p_level) { if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) { - // If this library is disabled manually before deleting the scene tree (hot-reload), // then an attempt is made to delete this node manually. DebugDrawManager *debug_draw_manager = Object::cast_to(ObjectDB::get_instance(debug_draw_manager_id));