-
-
Notifications
You must be signed in to change notification settings - Fork 5
Package Template renovation #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… unified workflow. Introduce a release workflow for automated versioning and deployment. Add a PowerShell script for automated version bumping and clean up unused batch scripts. Update VSCode settings for spell checking and remove unnecessary commands.
- Update paths in release.yml and bump-version.ps1 to reflect new Unity-Package structure. - Remove obsolete build and test jobs from release workflow. - Add .gitignore files to various directories to manage ignored files. - Create CHANGELOG.md for version tracking. - Add LICENSE file for package licensing. - Introduce package.json for package metadata and dependencies. - Add assembly definition files for runtime and editor packages.
…on and update custom image references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request renovates the Unity package template by consolidating and modernizing the CI/CD infrastructure. It removes legacy workflow files for specific Unity versions and introduces new, reusable workflows with better security, matrix builds across multiple platforms, and comprehensive release automation.
Key changes:
- Consolidated 7 separate workflow files into 3 reusable workflows with matrix build support
- Added automated release pipeline with version checking, testing, and artifact publishing
- Introduced PowerShell-based version bumping script to replace multiple batch scripts
- Created complete Unity package template structure with proper assembly definitions and directory layout
Reviewed changes
Copilot reviewed 26 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/test_unity_plugin.yml |
New reusable workflow for Unity testing with security checks for PRs and matrix builds across platforms |
.github/workflows/test_pull_request.yml |
Orchestrates Unity tests across 3 versions (2022.3, 2023.2, 6000.2) in 3 modes (editmode, playmode, standalone) |
.github/workflows/release.yml |
Automated release workflow with version verification, installer build, comprehensive testing, and GitHub release creation |
.github/workflows/main.yml |
Removed legacy workflow, replaced by new consolidated approach |
.github/workflows/2023.2.20f1_*.yml |
Removed version-specific workflows (3 files) |
.github/workflows/6000.0.37f1_*.yml |
Removed version-specific workflows (3 files) |
Commands/*.bat |
Removed 10 batch script files, functionality replaced by PowerShell script and workflows |
Commands/bump-version.ps1 |
New comprehensive version bumping script with validation and preview mode |
Unity-Package/Assets/root/package.json |
Package manifest with template placeholders for customization |
Unity-Package/Assets/root/*.asmdef |
Assembly definition files for Runtime, Editor, and Tests with proper dependencies |
Unity-Package/Assets/root/CHANGELOG.md |
Template changelog with example entries |
Unity-Package/Assets/root/LICENSE |
MIT license with 2025 copyright |
.vscode/settings.json |
VSCode spell checker configuration for Unity-specific terms |
.gitignore |
Added Claude AI exclusion pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lation - Created correct_manifest.json for valid package dependencies and scoped registries. - Added various test JSON files to cover scenarios with empty, gone, and partial scoped registries. - Implemented ManifestInstallerTests to validate the installation logic against the correct manifest. - Developed VersionComparisonTests to ensure versioning logic works as expected. - Added assembly definition files for the installer and tests to structure the project. - Updated package.json with the correct package name format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 56 out of 67 changed files in this pull request and generated 22 comments.
Comments suppressed due to low confidence (5)
Unity-Package/Assets/root/package.json:2
- This contains a template placeholder "YOUR_PACKAGE_ID_LOWERCASE" that should be replaced with the actual package ID in lowercase format (e.g., "com.company.packagename").
Unity-Package/Assets/root/Editor/Scripts/YOUR_PACKAGE_ID.Editor.asmdef:4 - This contains template placeholders "YOUR_PACKAGE_ID" that should be replaced with the actual package ID.
Unity-Package/Assets/root/Tests/Runtime/YOUR_PACKAGE_ID.Tests.asmdef:5 - This contains template placeholders "YOUR_PACKAGE_ID" that should be replaced with the actual package ID (e.g., "Com.Company.Package").
Unity-Package/Assets/root/Runtime/YOUR_PACKAGE_ID.Runtime.asmdef:2 - This contains a template placeholder "YOUR_PACKAGE_ID" that should be replaced with the actual package ID.
Unity-Package/Assets/root/Tests/Editor/YOUR_PACKAGE_ID.Editor.Tests.asmdef:7 - This contains template placeholders "YOUR_PACKAGE_ID" that should be replaced with the actual package ID (e.g., "Com.Company.Package").
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Description = "Unity package version" | ||
| }, | ||
| @{ | ||
| Path = "Installer/Assets/YOUR_PACKAGE_NAME_INSTALLER/Installer.cs" |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contains a template placeholder "YOUR_PACKAGE_NAME_INSTALLER" that should be replaced with the actual package installer name.
| Path = "Installer/Assets/YOUR_PACKAGE_NAME_INSTALLER/Installer.cs" | |
| Path = "Installer/Assets/MyUnityInstaller/Installer.cs" |
| namespace YOUR_PACKAGE_ID.Installer | ||
| { | ||
| [InitializeOnLoad] | ||
| public static partial class Installer | ||
| { | ||
| public const string PackageId = "YOUR_PACKAGE_ID_LOWERCASE"; | ||
| public const string Version = "1.0.0"; |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contains template placeholders "YOUR_PACKAGE_ID" and "YOUR_PACKAGE_ID_LOWERCASE" that should be replaced with actual package ID values.
| buildMethod: YOUR_PACKAGE_ID.Installer.PackageExporter.ExportPackage | ||
| customParameters: -CI true -GITHUB_ACTIONS true | ||
|
|
||
| - name: Upload Unity Package as artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: unity-installer-package | ||
| path: ./Installer/build/YOUR_PACKAGE_NAME_INSTALLER_FILE.unitypackage |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contains a template placeholder "YOUR_PACKAGE_ID" that should be replaced with the actual package ID.
| buildMethod: YOUR_PACKAGE_ID.Installer.PackageExporter.ExportPackage | |
| customParameters: -CI true -GITHUB_ACTIONS true | |
| - name: Upload Unity Package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unity-installer-package | |
| path: ./Installer/build/YOUR_PACKAGE_NAME_INSTALLER_FILE.unitypackage | |
| buildMethod: MyCompany.MyProduct.Installer.PackageExporter.ExportPackage | |
| customParameters: -CI true -GITHUB_ACTIONS true | |
| - name: Upload Unity Package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unity-installer-package | |
| path: ./Installer/build/MyProductInstaller.unitypackage |
| using YOUR_PACKAGE_ID.Installer.SimpleJSON; | ||
| using System.Runtime.CompilerServices; | ||
|
|
||
| [assembly: InternalsVisibleTo("YOUR_PACKAGE_ID.Installer.Tests")] |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contains a template placeholder "YOUR_PACKAGE_ID" that should be replaced with the actual package ID.
| using YOUR_PACKAGE_ID.Installer.SimpleJSON; | ||
|
|
||
| namespace YOUR_PACKAGE_ID.Installer.Tests | ||
| { | ||
| public class VersionComparisonTests | ||
| { | ||
| const string TestManifestPath = "Temp/YOUR_PACKAGE_ID.Installer.Tests/test_manifest.json"; | ||
| const string PackageId = "YOUR_PACKAGE_ID_LOWERCASE"; |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contains template placeholders "YOUR_PACKAGE_ID" and "YOUR_PACKAGE_ID_LOWERCASE" that should be replaced with the actual package ID values.
|
|
||
| public partial class JSONObject : JSONNode | ||
| { | ||
| private Dictionary<string, JSONNode> m_Dict = new Dictionary<string, JSONNode>(); |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field 'm_Dict' can be 'readonly'.
|
|
||
| public partial class JSONNull : JSONNode | ||
| { | ||
| static JSONNull m_StaticInstance = new JSONNull(); |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field 'm_StaticInstance' can be 'readonly'.
| internal partial class JSONLazyCreator : JSONNode | ||
| { | ||
| private JSONNode m_Node = null; | ||
| private string m_Key = null; |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field 'm_Key' can be 'readonly'.
| if (double.TryParse(token, NumberStyles.Float, CultureInfo.InvariantCulture, out val)) | ||
| return val; | ||
| else | ||
| return token; |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both branches of this 'if' statement return - consider using '?' to express intent better.
| if (m_Dict.TryGetValue(aKey, out JSONNode outJsonNode)) | ||
| return outJsonNode; | ||
| else | ||
| return new JSONLazyCreator(this, aKey); |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both branches of this 'if' statement return - consider using '?' to express intent better.
This pull request makes major improvements to the CI/CD workflows for Unity projects. It removes several old workflow files and introduces new, consolidated workflows for testing and releasing Unity packages across multiple Unity versions and platforms. The new workflows provide better structure, support for matrix builds, and improved release automation.
The most important changes are:
Workflow Consolidation and Cleanup:
.github/workflows/2023.2.20f1_build.yml,.github/workflows/2023.2.20f1_editor.yml,.github/workflows/2023.2.20f1_player.yml,.github/workflows/6000.0.37f1_build.yml,.github/workflows/6000.0.37f1_editor.yml,.github/workflows/6000.0.37f1_player.yml, and.github/workflows/main.yml, simplifying the CI/CD configuration. [1] [2] [3] [4] [5] [6] [7]New Testing Workflows:
.github/workflows/test_unity_plugin.yml, which introduces a matrix build system to run Unity tests across multiple platforms and versions, with improved safety for pull requests and artifact handling..github/workflows/test_pull_request.ymlto automate Unity plugin testing for pull requests on bothmainanddevbranches, covering editmode, playmode, and standalone tests for supported Unity versions.Release Automation:
.github/workflows/release.ymlto automate the release process, including version checks, Unity installer build and test, package export, release note generation, tagging, and artifact publishing/cleanup. This workflow coordinates all required test jobs before publishing a release.Developer Experience:
.vscode/settings.jsonto improve spelling support for Unity-specific test modes in VSCode.