An action wrapper of https://git.weatherelectric.xyz/MabelAmber/UnityPackager
- ShaderLab 85%
- C# 15%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| _tests_ | ||
| bin | ||
| action.yml | ||
| CHANGELOG.md | ||
| LICENSE.md | ||
| README.md | ||
Unity Packager Action
An action wrapper of UnityPackager
Builds a .unitypackage from a folder of assets and their .meta files, allowing you to create Unity Packages without needing Unity itself installed.
Usage
steps:
- uses: actions/checkout@v4
- name: Build package
id: package
uses: https://git.weatherelectric.xyz/actions/unity-packager@v1
with:
source-dir: PackageAssets
unity-root: Assets/MyPackage
output-dir: build
output-name: MyPackage
- run: echo "Built ${{ steps.package.outputs.package-path }}"
Inputs
| Name | Required | Default | Description |
|---|---|---|---|
source-dir |
yes | Folder containing the assets and their .meta files |
|
unity-root |
yes | Path the assets install to inside a Unity project, e.g. Assets/MyPackage |
|
output-dir |
no | . |
Directory to write the package to |
output-name |
yes | Package name, with or without the .unitypackage extension |
|
setup-dotnet |
no | true |
Install .NET with actions/setup-dotnet. Set to false if your runner image already has .NET 10 |
Outputs
| Name | Description |
|---|---|
package-path |
Full path of the built package |
Notes
- Every file and folder in
source-dirneeds a matching.metafile with a validguid. The build fails and lists any that don't, and also fails if two assets share a GUID. - Hidden files and folders (starting with
.), names ending in~,.metaor.tmp, andcvsare ignored, just like in Unity. - Keep
output-diroutsidesource-dir. A leftover.unitypackageinside the source folder has no.metafile and will fail the next build. unity-rootshould start withAssets/orPackages/. If it does not, Unity will still read it, but it will skip importing, so it builds with a warning.
Supported Platforms
Due to the nature of this using .NET apps, it has to use versions compiled per platform.
I don't own a Mac. I didn't bother compiling for Mac. I can't test on Mac. This will not work on MacOS.
This will only work on Windows and Linux.