From 19948c8186371f9dc8c7939ff8f4ce4147a85c57 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Sun, 2 Nov 2025 22:37:50 +0100 Subject: [PATCH 1/9] Added possibility to specify sample branch --- .yamato/project-builders/builder.metafile | 7 ++++--- .yamato/project-builders/project-builders.yml | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.yamato/project-builders/builder.metafile b/.yamato/project-builders/builder.metafile index 16a865ba8c..b261d28dea 100644 --- a/.yamato/project-builders/builder.metafile +++ b/.yamato/project-builders/builder.metafile @@ -2,20 +2,21 @@ NetcodeProjects: # Note that we are using internal Unity repo. This means that we may test with newest changes that are not yet released to our users (there are also public versions) + # The parameters specify repo location, default branch to use (since you can modify it via job variable), path to manifest.json file so we can replace package entry and path to the project root folder since it differs between projects # Note that for BossRoom 'main' branch supports NGOv1.X and 'develop' branch supports NGOv2.X # TODO: For BossRoom correct branch to develop when PR-3736 is merged in their repo BossRoom: GithubRepo: "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git" - branch: ngo-playtest-update + defaultBranch: ngo-playtest-update manifestPath: Packages/manifest.json projectPath: '.' Asteroids: GithubRepo: "https://github.cds.internal.unity3d.com/unity/Asteroids-CMB-NGO-Sample.git" - branch: main + defaultBranch: main manifestPath: Packages/manifest.json projectPath: '.' SocialHub: GithubRepo: "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize.git" - branch: main + defaultBranch: main manifestPath: Basic/DistributedAuthoritySocialHub/Packages/manifest.json projectPath: 'Basic/DistributedAuthoritySocialHub' diff --git a/.yamato/project-builders/project-builders.yml b/.yamato/project-builders/project-builders.yml index bb463d9526..e7f859a8de 100644 --- a/.yamato/project-builders/project-builders.yml +++ b/.yamato/project-builders/project-builders.yml @@ -30,13 +30,14 @@ build_{{ netcodeProject[0] }}_project: SCRIPTING_BACKEND_IL2CPP_MONO: il2cpp BURST_ON_OFF: on PLATFORM_WIN64_MAC_ANDROID: win64 + SAMPLE_BRANCH: {{ netcodeProject[1].defaultBranch }} commands: # Validate inputs passed via Yamato variables - python Tools/scripts/BuildAutomation/validate_params.py - echo Building {{ netcodeProject[0] }} project with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID% # Clone the external project repository into a specific directory. Notice that branch is also specified. - - git clone --single-branch --branch {{ netcodeProject[1].branch }} {{ netcodeProject[1].GithubRepo }} C:/ClonedProject + - git clone --single-branch --branch %SAMPLE_BRANCH% {{ netcodeProject[1].GithubRepo }} C:/ClonedProject # Modify the external project's manifest to use the local N4E package from current branch on which this Yamato job is running. (requires python that should be preinstalled in the image) - python Tools/scripts/BuildAutomation/manifest_update.py --manifest-path C:/ClonedProject/{{ netcodeProject[1].manifestPath }} --local-package-path %YAMATO_SOURCE_DIR%/com.unity.netcode.gameobjects From b62d9fa08ab7b0656b8e9c7cc5c05d98c6aaa29b Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Sun, 2 Nov 2025 22:47:46 +0100 Subject: [PATCH 2/9] Updated variable check to be case insensitive --- .yamato/project-builders/project-builders.yml | 10 +++++----- .../BuildAutomation/disable-enable-burst.py | 4 ++-- .../BuildAutomation/validate_params.py | 19 +++++++------------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.yamato/project-builders/project-builders.yml b/.yamato/project-builders/project-builders.yml index e7f859a8de..347bf20809 100644 --- a/.yamato/project-builders/project-builders.yml +++ b/.yamato/project-builders/project-builders.yml @@ -62,21 +62,21 @@ build_{{ netcodeProject[0] }}_project: # Build the project using Unity Editor. This will call the given static BuilderScripts method. # Ideally, it would be nice to parametrize the BuilderScripts (for example to pass scripting backend as parameter) but -executeMethod only calls static methods without parameters so for now we will have multiple configurations # Notice that for Android platform even if mono is selected, il2cpp will be used since mono is not supported for Android builds. - - IF "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" ( - IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" ( + - IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" ( + IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" ( C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit ) ELSE ( C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit ) ) - ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" ( - IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" ( + ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" ( + IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" ( C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit ) ELSE ( C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit ) ) - ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="android" ( + ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="android" ( C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget android -executeMethod BuilderScripts.BuildAndroidIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit ) diff --git a/Tools/scripts/BuildAutomation/disable-enable-burst.py b/Tools/scripts/BuildAutomation/disable-enable-burst.py index 9c295bd5a5..d9cd0b29e6 100644 --- a/Tools/scripts/BuildAutomation/disable-enable-burst.py +++ b/Tools/scripts/BuildAutomation/disable-enable-burst.py @@ -52,7 +52,7 @@ def create_config(settings_path): # Note that this jobs uses environment variables to pass parameters to the script. def resolve_target(): # Get the platform value from the environment variable - platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID') + platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower() resolved_target = platform_key if 'win64' == platform_key: @@ -95,7 +95,7 @@ def main(): parse_args() config_names = get_or_create_burst_AOT_config() - platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID') + platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower() print(f"Burst compilation script: Unity project path is {args.project_path}") print(f"Burst compilation script: Target platform is {platform_key}") diff --git a/Tools/scripts/BuildAutomation/validate_params.py b/Tools/scripts/BuildAutomation/validate_params.py index d95c065626..4c105836cc 100644 --- a/Tools/scripts/BuildAutomation/validate_params.py +++ b/Tools/scripts/BuildAutomation/validate_params.py @@ -1,4 +1,4 @@ -import os +import os import sys # --- Configuration --- @@ -17,13 +17,11 @@ def main(): """ all_params_valid = True - # Iterate through the dictionary of rules. for var_name, allowed_values in VALIDATION_RULES.items(): - # Get the variable's value from the environment. - actual_value = os.environ.get(var_name, '') + actual_value = os.environ.get(var_name, '').lower() + allowed_values_lower = {v.lower() for v in allowed_values} - # Check if the actual value is in the set of allowed values. - if actual_value not in allowed_values: + if actual_value not in allowed_values_lower: print( f"ERROR: Invalid {var_name}: '{actual_value}'. " f"Allowed values are: {list(allowed_values)}", @@ -31,9 +29,8 @@ def main(): ) all_params_valid = False - # --- Validation for Invalid Combinations --- - platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID') - scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO') + platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID', '').lower() + scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO', '').lower() if platform == 'mac' and scripting_backend == 'il2cpp': print( @@ -51,13 +48,11 @@ def main(): ) all_params_valid = False - # --- Final Result --- if not all_params_valid: print("\nOne or more parameters failed validation. Halting build.", file=sys.stderr) - # Exit with a non-zero code to fail the Yamato job. sys.exit(1) print("All parameters are valid. Proceeding with the build.") if __name__ == "__main__": - main() + main() \ No newline at end of file From b0a74cd1db9bb9777531531e5d01941ee1600b0e Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 08:54:26 +0100 Subject: [PATCH 3/9] Added debug info --- .yamato/project-builders/project-builders.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/project-builders/project-builders.yml b/.yamato/project-builders/project-builders.yml index 347bf20809..d4fc1f2d02 100644 --- a/.yamato/project-builders/project-builders.yml +++ b/.yamato/project-builders/project-builders.yml @@ -34,7 +34,7 @@ build_{{ netcodeProject[0] }}_project: commands: # Validate inputs passed via Yamato variables - python Tools/scripts/BuildAutomation/validate_params.py - - echo Building {{ netcodeProject[0] }} project with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID% + - echo Building {{ netcodeProject[0] }} project from branch {{ netcodeProject[1].defaultBranch }} with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID% # Clone the external project repository into a specific directory. Notice that branch is also specified. - git clone --single-branch --branch %SAMPLE_BRANCH% {{ netcodeProject[1].GithubRepo }} C:/ClonedProject From b816782b1977465fd949a3124c1be4c6fb52fcf4 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 09:02:19 +0100 Subject: [PATCH 4/9] Corrected release automation frequency and changed branch for local testing --- .yamato/ngo-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index 5be98b6772..dbb4830aa3 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -3,8 +3,8 @@ ngo_release_preparation: agent: { type: Unity::VM, flavor: b1.small, image: package-ci/ubuntu-22.04:v4 } triggers: recurring: - - branch: develop-2.0.0 # We make new releases from this branch - frequency: "10 * * 1" # Runs every Sunday at 10:00 AM + - branch: build-automation-update # We make new releases from this branch + frequency: "10 * ? 2" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub From b79eb632559bbb896ff100ae41337368ad77f239 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 10:38:36 +0100 Subject: [PATCH 5/9] typo --- .yamato/ngo-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index dbb4830aa3..d91a02db8b 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -4,7 +4,7 @@ ngo_release_preparation: triggers: recurring: - branch: build-automation-update # We make new releases from this branch - frequency: "10 * ? 2" # Runs every Sunday at 10:00 AM + frequency: "10 ? * 2" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub From b4b00b26bd7171bc86eb5f189b5a6b1461113794 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 10:38:45 +0100 Subject: [PATCH 6/9] test --- .yamato/ngo-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index d91a02db8b..7a00ccb196 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -4,7 +4,7 @@ ngo_release_preparation: triggers: recurring: - branch: build-automation-update # We make new releases from this branch - frequency: "10 ? * 2" # Runs every Sunday at 10:00 AM + frequency: "11 ? * 2" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub From 2763b262a5041d415c66e8e4a8bac02f0a60ebbd Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 11:31:53 +0100 Subject: [PATCH 7/9] corrected frequency --- .yamato/ngo-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index 7a00ccb196..bc1198fd06 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -4,7 +4,7 @@ ngo_release_preparation: triggers: recurring: - branch: build-automation-update # We make new releases from this branch - frequency: "11 ? * 2" # Runs every Sunday at 10:00 AM + frequency: "12 ? * 1" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub From 0cbdbc2598a4cfe09d332c2966492be40f9c1f74 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 12:19:15 +0100 Subject: [PATCH 8/9] test --- .yamato/ngo-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index bc1198fd06..10e89655d7 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -4,7 +4,7 @@ ngo_release_preparation: triggers: recurring: - branch: build-automation-update # We make new releases from this branch - frequency: "12 ? * 1" # Runs every Sunday at 10:00 AM + frequency: "12 ? * 2" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub From e50dffa2d1c8e71fb013e91d3e4cc9cabb55a377 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Mon, 3 Nov 2025 15:18:51 +0100 Subject: [PATCH 9/9] Updated corrected trigger --- .yamato/ngo-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/ngo-publish.yml b/.yamato/ngo-publish.yml index 10e89655d7..0870693972 100644 --- a/.yamato/ngo-publish.yml +++ b/.yamato/ngo-publish.yml @@ -3,8 +3,8 @@ ngo_release_preparation: agent: { type: Unity::VM, flavor: b1.small, image: package-ci/ubuntu-22.04:v4 } triggers: recurring: - - branch: build-automation-update # We make new releases from this branch - frequency: "12 ? * 2" # Runs every Sunday at 10:00 AM + - branch: develop-2.0.0 # We make new releases from this branch + frequency: "10 ? * 1" # Runs every Sunday at 10:00 AM rerun: always commands: - pip install PyGithub