A professional template for creating Unity packages with standardized structure and workflows.
- 📁 Standard Unity Package Layout
- 🔄 Automated GitHub Release Workflow
- 📦 Complete Package Configuration
- 🛠 Pre-configured Assembly Definitions
- 📝 Comprehensive Documentation Structure
com.template.package/
├── Runtime/ # Runtime code
├── Editor/ # Editor-specific code
├── Documentation~/ # Package documentation
├── .github/ # GitHub configurations
│ └── workflows/ # GitHub Actions
├── package.json # Package manifest
├── README.md # Package documentation
├── CHANGELOG.md # Version history
└── LICENSE # MIT license
- Click "Use this template" to create a new repository
- Clone your new repository
- Open the project in Unity
-
Update
package.json:{ "name": "com.company.package-name", // Unique package identifier "displayName": "Package Display Name", // Name in Package Manager "version": "1.0.0", // Semantic versioning "unity": "2022.3", // Minimum Unity version "description": "Package description", // Brief description "author": { "name": "Your Name", "email": "your.email@example.com" } } -
Configure Assembly Definitions:
- Runtime:
Runtime/com.company.package-name.Runtime.asmdef - Editor:
Editor/com.company.package-name.Editor.asmdef
- Runtime:
-
Configure repository settings:
- Navigate to Settings > Secrets and variables > Actions
- Add variable:
PACKAGE_NAME=com.company.package-name
-
Configure PAT for workflow triggers:
-
Create a Personal Access Token (PAT):
- Go to GitHub Settings > Developer settings > Personal access tokens
- Select "Tokens (classic)"
- Click "Generate new token (classic)"
- Set description and expiration (90 days recommended)
- Select only the
workflowpermission
-
Add PAT secret:
- Go to repository Settings > Secrets and variables > Actions
- Add new secret named
PAT - Value format (JSON):
{ "token": "your_pat_token", "targets": [ { "repo": "target-repo-name", "workflow": "workflow-file.yml" } ] }
-
-
Available GitHub Actions:
-
Release Workflow (
release.yml)- Automatically creates Unity package and GitHub release
- Generates release from CHANGELOG.md
- Creates both .unitypackage and .zip formats
- Can trigger other repository workflows after release
- Triggered manually from Actions tab
-
Cleanup Workflow (
cleanup.yml)- Helps manage repository releases and tags
- Can remove all releases and tags when needed
- Useful for development and maintenance
- Triggered manually from Actions tab
-
-
Code Organization
- Runtime code →
Runtime/ - Editor tools →
Editor/
- Runtime code →
-
Documentation
- API documentation →
Documentation~/ - Update README.md
- Maintain CHANGELOG.md
- API documentation →
-
Release Process
- Update version in package.json
- Update CHANGELOG.md with new version
- Run Release workflow from GitHub Actions
- Automated package and release creation
- Automatically triggers configured workflows in other repositories
- Open Package Manager window
- Click "+" button
- Select "Add package from git URL"
- Enter:
https://github.com/Yueby/Template-Package.git
- Clone repository
- In Package Manager, click "Add package from disk"
- Select the package folder
- Unity 2022.3.22f1 or higher
- Git
This project is licensed under the MIT License - see the LICENSE file for details.