Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
@xrtk/activate-unity-license@v4 (#9)
Browse files Browse the repository at this point in the history
- add 2FA support
- removed direct deps
  • Loading branch information
StephenHodgson authored Dec 3, 2023
1 parent 3fe7510 commit def788a
Show file tree
Hide file tree
Showing 17 changed files with 47,896 additions and 31,401 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.ref }}

Expand All @@ -20,7 +21,8 @@ jobs:
validate:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 2 # Use this if you're activating pro license with matrix
fail-fast: false
#max-parallel: 2 # Use this if you're activating pro license with matrix
matrix:
include:
- os: ubuntu-latest
Expand All @@ -42,19 +44,27 @@ jobs:
repository: xrtk/com.xrtk.test
path: test-project

# 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/[email protected]
with:
version-file-path: 'test-project/**/ProjectSettings/ProjectVersion.txt'
build-targets: ${{ matrix.build-target }}

# Activates the installation with the provided credentials
# https://github.com/XRTK/activate-unity-license
- name: xrtk/activate-unity-license
uses: ./
with:
# Required
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# Optional
license-type: 'Personal' # Chooses license type to use [ Personal, Professional ]
serial: ${{ secrets.UNITY_SERIAL }} # Required for pro/plus activations
license-type: 'Professional' # Chooses license type to use [ Personal, Professional ]
auth-key: ${{ secrets.UNITY_2FA_KEY }} # required for personal activations

- name: Unity Build (${{ matrix.build-target }})
uses: xrtk/unity-action@v6
Expand Down
9 changes: 0 additions & 9 deletions .puppeteerrc.cjs

This file was deleted.

24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ This action requires several secrets that need to be setup in the repository or

* `UNITY_USERNAME` The email address you use for your Unity Id
* `UNITY_PASSWORD` The password you use for Unity Id access
* `UNITY_SERIAL` (Required for pro/plus activations)
* `UNITY_SERIAL` Optional, but required for pro/plus activations
* `UNITY_2FA_KEY` Optional, but required for personal activations [2FA Auth Key Setup Steps](#2fa-auth-key-setup-steps)

> Don't forget that pro/plus licenses only support 2 active licenses at a time!
Expand All @@ -40,7 +41,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
#max-parallel: 2 # Use this if you're activating pro license with matrix
max-parallel: 2 # Use this if you're activating pro license with matrix
matrix:
include:
- os: ubuntu-latest
Expand All @@ -59,6 +60,8 @@ jobs:
# sets -> env.UNITY_PROJECT_PATH
# https://github.com/XRTK/unity-setup
- uses: xrtk/[email protected]
with:
build-targets: ${{ matrix.build-target }}

# Activates the installation with the provided credentials
- uses: xrtk/activate-unity-license@v3
Expand All @@ -67,6 +70,21 @@ jobs:
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# Optional
license-type: 'Professional' # Chooses license type to use [ Personal, Professional ]
serial: ${{ secrets.UNITY_SERIAL }} # Required for pro/plus activations
license-type: 'Personal' # Chooses license type to use [ Personal, Professional ]
# auth-key: ${{ secrets.UNITY_2FA_KEY }} # required for personal activations
```

### 2FA Auth Key Setup Steps

To activate new two factor authentication for your Unity account:

1. Login to Unity account and navigate to `Security`
2. Click `+` (activate) next to `Two Factor Authentication`
3. Select `Start setup`
4. Input password if prompted
5. Select `Authenticator App` to receive codes, then `Next`
6. Click `Can't Scan the barcode?`
7. Copy the 16 character key
8. Create new secret `UNITY_2FA_KEY` and save the generated key from the previous step
9. Scan the QR code in your Authenticator app and verify the code.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ inputs:
description: 'License type to activate (professional or personal)'
required: false
default: 'Personal'
auth-key:
description: "2FA (Authenticator App) key"
required: false
default: ''

runs:
using: 'node16'
main: 'dist/index.js'
Expand Down
Loading

0 comments on commit def788a

Please sign in to comment.