Consumer Integration Guide
This guide walks through configuring downstream Unity repositories to automatically build, sign, and publish UPM packages to the private TrickleCharge Verdaccio registry.
1. Repository Setup Requirements
For the CI/CD pipeline to discover and publish packages, consumer repositories must meet the following criteria:
- Packages must reside under a discoverable directory (default:
Packages/*). - Each package folder must contain a valid
package.jsonwith a validnameandversionfield.
2. GitHub Secrets Setup
Add the following secrets to your downstream GitHub repository (Settings > Secrets and variables > Actions):
| Secret | Description |
|---|---|
UNITY_ORG_ID |
Unity Organization ID for UPM CLI package signing |
UPM_SERVICE_ACCOUNT_KEY_ID |
Key ID for the Unity Service Account |
UPM_SERVICE_ACCOUNT_KEY_SECRET |
Key Secret for the Unity Service Account |
NODE_AUTH_TOKEN |
Auth token for https://npm.tricklecharge.dev |
3. Workflow Implementation
Create .github/workflows/publish.yml in your consumer repository:
name: Publish Packages
on:
push:
branches:
- main
jobs:
publish:
uses: Trickle-Charge/TrickleCharge-Infra/.github/workflows/publish-upm-packages.yml@main
with:
package-path: "Packages/*"
ignore-packages: "com.tricklecharge.template"
secrets:
UNITY_ORG_ID: ${{ secrets.UNITY_ORG_ID }}
UPM_SERVICE_ACCOUNT_KEY_ID: ${{ secrets.UPM_SERVICE_ACCOUNT_KEY_ID }}
UPM_SERVICE_ACCOUNT_KEY_SECRET: ${{ secrets.UPM_SERVICE_ACCOUNT_KEY_SECRET }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
4. How Publishing Works
- Trigger: Pushing to
maintriggers the caller workflow. - Version Check: The pipeline checks Verdaccio (
https://npm.tricklecharge.dev) forname@version. - Execution:
- If
versionalready exists on Verdaccio, the package is skipped. - If
versionis new, the UPM CLI signs and packs the package, then deploys it to Verdaccio.
- If