A template project for making UPM packages for Unity
First use this repository as the base of your UPM project repository by forking it.
Let's say the name of your package directory is ABC. Your UPM project directory will usually be Packages/ABC or Assets/ABC (let's assume it's Packages/ABC for this guide). A sample directory is included in the repo.
Inside which you'd have your package.json, CHANGELOG.md, LICENSE, README.md.
To know more about package.json (called the UPM Manifest) go here
Go to .github/workflows/ci.yml and change the value of XYZ to Packages/ABC.
If your branch name differs from 'master' and is for example 'main' replace:
on:
push:
branches:
- master
with:
on:
push:
branches:
- main
Every time you commit to master, this YML file is used to release your UPM package and automatically use a separate upm branch for releases as well as autogenerate tag for release. If you see the upm branch commits, you'll notice that your project directory is the root instead of the Unity project directory. Github Actions is used to automate this bit.
Semantic releases is used to automate changelog updates as well as incrementing the version field inside package.json (the UPM Manifest).
Go to .releaserc.yml do make the following changes:
XYZ1toPackages/ABCXYZ2toPackages/ABC/package.jsonXYZ3toPackages/ABC/CHANGELOG.md- 'PATH_TO_YOUR_CHANGELOG.MD' to
Packages/ABC/CHANGELOG.md
When using git commit, follow the Angular Standard
Use npm publish inside Packages/ABC or check out OpenUPM
Favo Yang's Medium Articles
OpenUPM Docs
Having a Docker Container As Your Private NPM Registry — The Easy Way by Sibeesh Venu