game-ci/unity-activate

How to use this tool?

jcs090218 opened this issue · 5 comments

Just a short question! :)

Please follow the documentation at https://game.ci

I've searched all over the website, CTRL+F'd where I can, used the search where I can -- there is nothing about game-ci/unity-activate in the documentation other than "Optionally, use this".

So, with some assumptions & pre-made code snippets, I end up with this workflow:

name: Set Up Unity Personal Licence
on:
  workflow_dispatch: {}
jobs:
  activation:
    name: Request manual activation file
    runs-on: ubuntu-latest
    steps:
      # Request manual activation file
      - name: Request manual activation file
        id: getManualLicenseFile
        uses: game-ci/unity-request-activation-file@v2
      # Upload artifact (Unity_v20XX.X.XXXX.alf)
      - name: Expose as artifact
        uses: actions/upload-artifact@v2
        with:
          name: ${{ steps.getManualLicenseFile.outputs.filePath }}
          path: ${{ steps.getManualLicenseFile.outputs.filePath }}
      # Activate?? This is the code snippet Github Actions Marketplace gives us.
      - name: Unity - Activate
        id: activateLicence
        uses: game-ci/unity-activate@v1.3
        

This workflow errors out on the "Unity - Activate" step, giving this error:

Activating Unity version "2019.2.11f1".
License activation strategy could not be determined.

Visit https://github.com/webbertakken/unity-builder#usage for more
details on how to set up one of the possible activation strategies.
Error: The process '/usr/bin/docker' failed with exit code 1

Why does this depend on Unity Builder? What is meant to be happening here? There is no documentation explaining any of this.

I can manually take the activation file and turn it into a licence just fine - there's plenty of helpful documentation on that in the link you provided. That's fine. But this action implies that the manual involvement can be replaced by some automation, and I've love to learn more about that.

So in the regular flow you don't need to use this action directly anymore, as activation happens within both test-runner and builder. Activating unity by itself will use up an activation slot, which you'll have to also return. In practice people just all end up using test-runner and builder for all their needs.

We're looking to fully automate the process for personal licenses as well. See game-ci/unity-actions#121

If you want to use this action, the signature is the same as builder. For personal license provide the username, password and file. For professional provide username, password and serial.

Hope this helps.

I used the same signature with build as shown in docs:

name: Verify license
on:
  workflow_dispatch: {}
jobs:
  activation:
    name: Verify license
    runs-on: ubuntu-latest
    steps:
      - name: Unity - Activate
        uses: game-ci/unity-activate@v2.0.0
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}

I am getting this:

License activation strategy could not be determined.

Visit https://game.ci/docs/github/getting-started for more
details on how to set up one of the possible activation strategies.
Error: The process '/usr/bin/docker' failed with exit code 1

What am I doing wrong?

I'll answer here once, but if the problem persists for any reason, please, kindly create a new issue.

When the action outputs License activation strategy could not be determined. it means you haven't set UNITY_LICENSE and also not provided a serial. You have to provide one or the other. In your case, your secret is not filled or not passed.