Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TrismegistusDevelopment/unity-package-manager-ci
Travis Ci scripts to push changes to specific branch for using with Unity Package Manager (UPM) system
https://github.com/TrismegistusDevelopment/unity-package-manager-ci
tool travis-ci unity unity-package-manager unitypackage upm
Last synced: 3 months ago
JSON representation
Travis Ci scripts to push changes to specific branch for using with Unity Package Manager (UPM) system
- Host: GitHub
- URL: https://github.com/TrismegistusDevelopment/unity-package-manager-ci
- Owner: TrismegistusDevelopment
- License: mit
- Created: 2019-04-15T19:17:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-07T08:11:52.000Z (about 5 years ago)
- Last Synced: 2024-10-30T00:04:32.238Z (4 months ago)
- Topics: tool, travis-ci, unity, unity-package-manager, unitypackage, upm
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unity-package-manager-ci
[](https://docs.unity3d.com/Manual/upm-dependencies.html)
[](https://travis-ci.org/)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](https://docs.unity3d.com/Manual/upm-dependencies.html#Git) `git` dependencies in it like this
```json
"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
* [Hermesiss/unity-splines](https://github.com/Hermesiss/unity-splines)
* [vladfaust/unity-wakatime](https://github.com/vladfaust/unity-wakatime)## 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](https://github.com/settings/tokens) with selected scope `repo`## Add files to repo
1. Open your project in Unity
1. Create `package.json` near your main folder (but inside `Assets`!) with keywords and category of your choice:
```json
{
"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"
}
```
1. Create [Assembly definition](https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html) file `com.company.repo.name.asmdef` in the same folder:
```json
{
"name": "Display Name of Your Asset"
}
```
If you have Editor folders, repeat for each:
1. Create Assembly definition files with only `editor` platform included
1. Add references to other necessary asmdefs
1. Make sure that `*.meta` files appeared. You now must have 6 items in your dir: 1 folder, 1 .json, 1 .asmdef and 3 .meta
1. Copy `.travis.yml` file and `ci` folder to project's root
1. 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
1. 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](https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html) in every Editor folder with only `Editor` checked in platforms