Skip to content

GitHub Action to activate unity license from secrets

License

Notifications You must be signed in to change notification settings

XRTK/activate-unity-license

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

activate-unity-license

An atomic GitHub Action that activates the Unity Engine license via cli with the provided secret parameters.

Part of the Mixed Reality Toolkit (XRTK) open source project.

This action does not require the use of XRTK in your Unity project.

Related Github Actions

How to use

This action uses your stored environment secrets to authenticate with the Unity Licensing servers.

It's important that you disable other forks of your repository to run actions in pull requests from unknown contributors.

Read more on Approving workflow runs from public forks

Managing GitHub Actions settings for a repository

Setup Secrets

This action requires several secrets that need to be setup in the repository or organization's action secret store.

  • UNITY_USERNAME The email address you use for your Unity Id
  • UNITY_PASSWORD The password you use for Unity Id access
  • UNITY_SERIAL Optional, but required for pro activations

Important

Don't forget that pro licenses only support 2 active licenses at a time!

Create Workflow file

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      # max-parallel: 2 # Use this if you're activating pro license with matrix
      matrix:
        include:
          - os: ubuntu-latest
            build-targets: StandaloneLinux64
          - os: windows-latest
            build-targets: StandaloneWindows64
          - os: macos-latest
            build-targets: StandaloneOSX

    steps:
      - uses: actions/checkout@v4

        # Installs the Unity Editor based on your project version text file
        # sets -> env.UNITY_EDITOR_PATH
        # sets -> env.UNITY_PROJECT_PATH
        # https://github.com/XRTK/unity-setup
      - uses: xrtk/unity-setup@v7
        with:
          build-targets: ${{ matrix.build-target }}

        # Activates the installation with the provided credentials
      - uses: xrtk/activate-unity-license@v5
        with:
          license-type: 'Personal' # Chooses license type to use [ Personal, Professional ]
          username: ${{ secrets.UNITY_USERNAME }}
          password: ${{ secrets.UNITY_PASSWORD }}
          # serial: ${{ secrets.UNITY_SERIAL }} # Required for pro activations