- Publish Unity Packages to UPM registry
- Automatic edit
package.json
andCHANGELOG.md
- Open Secrets settings
- Add new secrets: Name:
NPM_AUTH_TOKEN
, Value: Your auth token of UPM Registry - Add new secrets: Name:
NPM_REGISTRY_URL
, Value: Your UPM Registry URL.
Setup GitHub Actions Workflow as below example.
name: Publish UPM Package
on:
release:
types: [published]
jobs:
upm-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: monry/actions-upm-publish@v1
with:
npm_registry_url: ${{ secrets.NPM_REGISTRY_URL }}
npm_auth_token: ${{ secrets.NPM_AUTH_TOKEN }}
You can specify directory path of package.json
by set path into package_directory_path
(default: Assets
)
You can also specify registry URL using .npmrc
instead of specifying in actions workflow.
registry=[UPM Registry URL]
When you create a new release on GitHub, Actions are executed to do the following:
- Update
version
field inAssets/package.json
- Add release notes into
Assets/CHANGELOG.md
- Commit and Push to registry and replace hash of release tag