Skip to content

GitHub Actions to publish Unity packages to Unity Package Manager Registry

Notifications You must be signed in to change notification settings

scriptsengineer/actions-upm-publish

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for publish UPM

Features

  • Publish Unity Packages to UPM registry
  • Automatic edit package.json and CHANGELOG.md

Prepare

1. Setup Secrets in Repository Settings

  1. Open Secrets settings
    image
  2. Add new secrets: Name: NPM_AUTH_TOKEN, Value: Your auth token of UPM Registry
    image
  3. Add new secrets: Name: NPM_REGISTRY_URL, Value: Your UPM Registry URL.
    image

2. Setup GitHub Actions Workflow

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)

Note: Registry URL

You can also specify registry URL using .npmrc instead of specifying in actions workflow.

registry=[UPM Registry URL]

Usages

When you create a new release on GitHub, Actions are executed to do the following:

  • Update version field in Assets/package.json
  • Add release notes into Assets/CHANGELOG.md
  • Commit and Push to registry and replace hash of release tag

About

GitHub Actions to publish Unity packages to Unity Package Manager Registry

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 90.9%
  • Dockerfile 9.1%