Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .yamato/ngo-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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
- branch: develop-3.x.x # We make new releases from this branch
frequency: "10 ? * 1" # Runs every Sunday at 10:00 AM
commands:
- pip install PyGithub
Expand Down
9 changes: 9 additions & 0 deletions .yamato/package-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ package_pack_-_ngo_{{ platform.name }}:
variables:
XRAY_PROFILE: "gold ./pvpExceptions.json rme"
commands:
# Remove ValidationExceptions.json and its .meta file if they exist. For this specific test it's necessary (otherwise we want to keep them since we use those for release).
{% if platform.name == "win" %}
- if exist com.unity.netcode.gameobjects\ValidationExceptions.json del /f /q com.unity.netcode.gameobjects\ValidationExceptions.json
- if exist com.unity.netcode.gameobjects\ValidationExceptions.json.meta del /f /q com.unity.netcode.gameobjects\ValidationExceptions.json.meta
{% else %}
- rm -f com.unity.netcode.gameobjects/ValidationExceptions.json
- rm -f com.unity.netcode.gameobjects/ValidationExceptions.json.meta
{% endif %}

- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
Expand Down
4 changes: 2 additions & 2 deletions Tools/scripts/ReleaseAutomation/release_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class ReleaseConfig:
def __init__(self):
self.manifest_path = 'com.unity.netcode.gameobjects/package.json'
self.changelog_path = 'com.unity.netcode.gameobjects/CHANGELOG.md'
self.validation_exceptions_path = './ValidationExceptions.json'
self.validation_exceptions_path = 'com.unity.netcode.gameobjects/ValidationExceptions.json'
self.github_repo = 'Unity-Technologies/com.unity.netcode.gameobjects'
self.default_repo_branch = 'develop-2.0.0' # Changelog and package version change will be pushed to this branch
self.default_repo_branch = 'develop-3.x.x' # Changelog and package version change will be pushed to this branch
self.yamato_project_id = '1201'
self.command_to_run_on_release_branch = make_package_release_ready

Expand Down
19 changes: 13 additions & 6 deletions Tools/scripts/Utils/general_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,20 @@ def update_changelog(changelog_path, new_version, add_unreleased_template=False)
with open(changelog_path, 'r', encoding='UTF-8') as f:
changelog_text = f.read()

# This pattern finds a line starting with '###', followed by its newline,
# and then two more lines that contain only whitespace.
# This pattern finds a line starting with '###' followed only by blank lines up to the next heading or end of section.
# The re.MULTILINE flag allows '^' to match the start of each line.
pattern = re.compile(r"^###.*\n\n\n", re.MULTILINE)

# Replace every match with an empty string. The goal is to remove empty CHANGELOG subsections.
cleaned_content = pattern.sub('', changelog_text)
pattern = re.compile(r"^###[^\n]*\n(?:[ \t]*\n)*(?=##|\Z)", re.MULTILINE)
Comment thread
michalChrobot marked this conversation as resolved.

# Replace every match within the [Unreleased] section with an empty string. The goal is to remove empty CHANGELOG subsections.
# Released sections are left untouched since some of them use '###' for their version heading.
cleaned_content = changelog_text
unreleased_section = re.search(r'(?ms)^## \[Unreleased\].*?(?=^## \[|\Z)', changelog_text)
if unreleased_section:
cleaned_content = (
changelog_text[:unreleased_section.start()] +
pattern.sub('', unreleased_section.group(0)) +
changelog_text[unreleased_section.end():]
)

if version_header_to_find_if_exists in changelog_text:
warnings.warn(f"A changelog entry for version '{new_version}' already exists. The script will just remove Unreleased section and its content.")
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def make_package_release_ready(manifest_path, changelog_path, validation_excepti
if __name__ == '__main__':
manifest_path = 'com.unity.netcode.gameobjects/package.json'
changelog_path = 'com.unity.netcode.gameobjects/CHANGELOG.md'
validation_exceptions_path = './ValidationExceptions.json'
validation_exceptions_path = 'com.unity.netcode.gameobjects/ValidationExceptions.json'
package_version = get_package_version_from_manifest(manifest_path)

make_package_release_ready(manifest_path, changelog_path, validation_exceptions_path, package_version)
4 changes: 0 additions & 4 deletions ValidationExceptions.json

This file was deleted.

8 changes: 6 additions & 2 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Changed

- Updated Netcode for Entities dependency to 7.1.0

### Deprecated

### Removed
Expand All @@ -24,6 +22,12 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Obsolete

## [3.1.0] - 2026-10-04

### Changed

- Updated Netcode for Entities dependency to 7.1.0

## [3.0.0] - 2026-09-14

### Added
Expand Down
37 changes: 32 additions & 5 deletions com.unity.netcode.gameobjects/Editor/InScenePlacedProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,47 @@
using UnityEngine;
using UnityEngine.SceneManagement;

#if UNITY_7000_0_OR_NEWER
using UnityEditor.Build.Content;
#endif

namespace Unity.Netcode.GameObjects.Editor
{
/// <summary>
/// A <see cref="IProcessSceneWithReport"/> that sets the <see cref
/// A build scene callback that sets the <see cref
/// "NetworkObject.InScenePlaced"/> property to true for all <see cref="NetworkObject"/>s in the scene.
/// Ensures that InScenePlaced is always true for all objects in the scene.
/// </summary>
/// <remarks>
/// This will always run as the game enters the scene,
/// This will always run as a scene is loaded in playmode or while processed for a player build.
/// </remarks>
#if UNITY_7000_0_OR_NEWER
internal class SetInScenePlaced : AssetPostprocessor
{
public override uint GetVersion() => 1;

public override int GetPostprocessOrder() => 0;

void OnProcessScene(Scene scene, SceneImportContext sceneImportContext)
{
InScenePlaceChecks.ReportSceneIssues(scene, sceneImportContext.awakeDidRun);
}
}
#else
internal class SetInScenePlaced : IProcessSceneWithReport
{
public int callbackOrder => 0;

public void OnProcessScene(Scene scene, BuildReport report)
{
InScenePlaceChecks.ReportSceneIssues(scene, Application.isPlaying);
}
}
#endif

internal static class InScenePlaceChecks
{
public static void ReportSceneIssues(Scene scene, bool hasAwakeRun)
{
var log = new ContextualLogger();
log.AddInfo(scene.name, scene.handle);
Expand All @@ -42,15 +69,15 @@ public void OnProcessScene(Scene scene, BuildReport report)
continue;
}

// If already marked, the do nothing.
// If already marked, do nothing.
if (networkObject.InScenePlaced)
{
continue;
}

networkObject.InScenePlaced = true;
// Will not be true when making a build and the values are serialized.
networkObject.InScenePlacedPostProcessorMarkedDuringRuntime = Application.isPlaying;
// Mark that awake has run so this could have been a dynamically instantiated object.
networkObject.InScenePlacedPostProcessorMarkedDuringRuntime = hasAwakeRun;
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions com.unity.netcode.gameobjects/ValidationExceptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ErrorExceptions": [
{
"ValidationTest": "NDA Keyword Validation",
"ExceptionMessage": "#if UNITY_7000_0_OR_NEWER",
"PackageVersion": "3.1.1"
},
{
"ValidationTest": "NDA Keyword Validation",
"ExceptionMessage": "File 'Editor/InScenePlacedProcessor.cs' contains deny-listed keyword pattern '(?<!BestPracticeUnderstandingPerformanceIn)unity[ _]*7' It must not be published",
"PackageVersion": "3.1.1"
}
],
"WarningExceptions": []
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion com.unity.netcode.gameobjects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.unity.netcode.gameobjects",
"displayName": "Netcode for GameObjects",
"description": "Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.",
"version": "3.1.0",
"version": "3.1.1",
"unity": "6000.7",
"unityRelease": "0b1",
"dependencies": {
Expand Down
Loading