Skip to content

TrismegistusDevelopment/unity-package-manager-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

unity-package-manager-ci

Travis Ci scripts to push changes to specific branch for using with Unity Package Manager (UPM) system

How Unity Package Manager works with git

There's Packages/manifest.json in your Unity project folder. You can manually add git dependencies in it like this

"com.company.repo.name": "https://YourGitHost.com/UserName/RepoName.git#BranchName"

To update asset through UPM you must delete reference in lock section in manifest.

Currently you must follow strict rules if you want to use your asset like this. Most importantly, aux files (manifest, asmdef) must be in repo root and have *.meta files.

This repo will help you set up CI for separate UPM branch

Examples

Configure Travis

  1. Register at https://travis-ci.org/ for public or at https://travis-ci.com/ for private repos
  2. Open repo settings, go to Environment Variables
  3. Add variable with exact name GITHUB_TOKEN and value from created token with selected scope repo

Add files to repo

  1. Open your project in Unity
  2. Create package.json near your main folder (but inside Assets!) with keywords and category of your choice:
    {
    	"name": "com.company.repo.name",
    	"displayName": "Display Name of Your Asset",
    	"version": "0.1.1",
    	"unity": "2018.3",
    	"description": "Short description of your asset",
    	"keywords": [
    		"unity", "editor"		
    	],
    	"category": "Instrument"
    }
  3. Create Assembly definition file com.company.repo.name.asmdef in the same folder:
    {
    	"name": "Display Name of Your Asset"
    }
    If you have Editor folders, repeat for each:
    1. Create Assembly definition files with only editor platform included
    2. Add references to other necessary asmdefs
  4. Make sure that *.meta files appeared. You now must have 6 items in your dir: 1 folder, 1 .json, 1 .asmdef and 3 .meta
  5. Copy .travis.yml file and ci folder to project's root
  6. Edit .travis.yml, change env variables - target branches and folder to export. If you want to test this config, add custom test branch to branches: only: section
  7. Commit and push changes

Different info

  • If your commit doesn't require CI (like readme editing) you can add [skip ci] into your commit message and Travis won't build it
  • Unity is not consistent while handling Editor folders in packages during build, so it's mandatory to wrap all editor scripts in #IF UNITY_EDITOR ... #ENDIF or make new asmdef file in every Editor folder with only Editor checked in platforms

About

Travis Ci scripts to push changes to specific branch for using with Unity Package Manager (UPM) system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages