Skip to content

Commit c4ccbb8

Browse files
chore: [Backport] Small automations update (#3775)
chore: Small automations update (#3772) * Added possibility to specify sample branch * Updated variable check to be case insensitive * Added debug info * Corrected release automation frequency and changed branch for local testing * typo * test * corrected frequency * test * Updated corrected trigger
1 parent 1eeecc6 commit c4ccbb8

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

.yamato/ngo-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ngo_release_preparation:
44
triggers:
55
recurring:
66
- branch: develop # We make new releases from this branch
7-
frequency: "10 * * 1" # Runs every Sunday at 10:00 AM
7+
frequency: "10 ? * 1" # Runs every Sunday at 10:00 AM
88
rerun: always
99
commands:
1010
- pip install PyGithub

.yamato/project-builders/builder.metafile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
NetcodeProjects:
44
# 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)
5+
# 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
56
# Note that for BossRoom 'main' branch supports NGOv1.X and 'develop' branch supports NGOv2.X
67
# Recently (19.08.2025) BossRoom got an update to 3.0.0 version which updated everything to U6 and NGOv2.X. Because of that I branched out from last commit that was supporting NGOv1.X for our playtest usage
78
BossRoom:
89
GithubRepo: "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git"
9-
branch: playtest/ngo-1.x
10+
defaultBranch: playtest/ngo-1.x
1011
manifestPath: Packages/manifest.json
1112
projectPath: '.'

.yamato/project-builders/project-builders.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ build_{{ netcodeProject[0] }}_project:
3030
SCRIPTING_BACKEND_IL2CPP_MONO: il2cpp
3131
BURST_ON_OFF: on
3232
PLATFORM_WIN64_MAC_ANDROID: win64
33+
SAMPLE_BRANCH: {{ netcodeProject[1].defaultBranch }}
3334
commands:
3435
# Validate inputs passed via Yamato variables
3536
- python Tools/scripts/BuildAutomation/validate_params.py
36-
- 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%
37+
- 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%
3738

3839
# Clone the external project repository into a specific directory. Notice that branch is also specified.
39-
- git clone --single-branch --branch {{ netcodeProject[1].branch }} {{ netcodeProject[1].GithubRepo }} C:/ClonedProject
40+
- git clone --single-branch --branch %SAMPLE_BRANCH% {{ netcodeProject[1].GithubRepo }} C:/ClonedProject
4041

4142
# 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)
4243
- python Tools/scripts/BuildAutomation/manifest_update.py --manifest-path C:/ClonedProject/{{ netcodeProject[1].manifestPath }} --local-package-path %YAMATO_SOURCE_DIR%/com.unity.netcode.gameobjects
@@ -61,21 +62,21 @@ build_{{ netcodeProject[0] }}_project:
6162
# Build the project using Unity Editor. This will call the given static BuilderScripts method.
6263
# 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
6364
# Notice that for Android platform even if mono is selected, il2cpp will be used since mono is not supported for Android builds.
64-
- IF "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" (
65-
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
65+
- IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" (
66+
IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
6667
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
6768
) ELSE (
6869
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
6970
)
7071
)
71-
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" (
72-
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
72+
ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" (
73+
IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
7374
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
7475
) ELSE (
7576
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
7677
)
7778
)
78-
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="android" (
79+
ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="android" (
7980
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
8081
)
8182

Tools/scripts/BuildAutomation/disable-enable-burst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_config(settings_path):
5252
# Note that this jobs uses environment variables to pass parameters to the script.
5353
def resolve_target():
5454
# Get the platform value from the environment variable
55-
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
55+
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower()
5656

5757
resolved_target = platform_key
5858
if 'win64' == platform_key:
@@ -95,7 +95,7 @@ def main():
9595
parse_args()
9696
config_names = get_or_create_burst_AOT_config()
9797

98-
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
98+
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower()
9999
print(f"Burst compilation script: Unity project path is {args.project_path}")
100100
print(f"Burst compilation script: Target platform is {platform_key}")
101101

Tools/scripts/BuildAutomation/validate_params.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import os
22
import sys
33

44
# --- Configuration ---
@@ -17,23 +17,20 @@ def main():
1717
"""
1818
all_params_valid = True
1919

20-
# Iterate through the dictionary of rules.
2120
for var_name, allowed_values in VALIDATION_RULES.items():
22-
# Get the variable's value from the environment.
23-
actual_value = os.environ.get(var_name, '')
21+
actual_value = os.environ.get(var_name, '').lower()
22+
allowed_values_lower = {v.lower() for v in allowed_values}
2423

25-
# Check if the actual value is in the set of allowed values.
26-
if actual_value not in allowed_values:
24+
if actual_value not in allowed_values_lower:
2725
print(
2826
f"ERROR: Invalid {var_name}: '{actual_value}'. "
2927
f"Allowed values are: {list(allowed_values)}",
3028
file=sys.stderr
3129
)
3230
all_params_valid = False
3331

34-
# --- Validation for Invalid Combinations ---
35-
platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
36-
scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO')
32+
platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID', '').lower()
33+
scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO', '').lower()
3734

3835
if platform == 'mac' and scripting_backend == 'il2cpp':
3936
print(
@@ -51,13 +48,11 @@ def main():
5148
)
5249
all_params_valid = False
5350

54-
# --- Final Result ---
5551
if not all_params_valid:
5652
print("\nOne or more parameters failed validation. Halting build.", file=sys.stderr)
57-
# Exit with a non-zero code to fail the Yamato job.
5853
sys.exit(1)
5954

6055
print("All parameters are valid. Proceeding with the build.")
6156

6257
if __name__ == "__main__":
63-
main()
58+
main()

0 commit comments

Comments
 (0)