This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@xrtk/activate-unity-license@v1 (#1)
- Loading branch information
1 parent
380eb27
commit 6dd9a21
Showing
25 changed files
with
58,237 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: StephenHodgson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: validate | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
|
||
jobs: | ||
validate: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
#max-parallel: 2 # Use this if you're activating pro license with matrix | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
build-target: StandaloneLinux64 | ||
- os: windows-latest | ||
build-target: StandaloneWindows64 | ||
- os: macos-latest | ||
build-target: StandaloneOSX | ||
|
||
steps: | ||
- name: checkout self | ||
uses: actions/checkout@v3 | ||
|
||
- run: npm install | ||
|
||
- name: checkout test project | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: xrtk/com.xrtk.test | ||
path: test-project | ||
|
||
- uses: xrtk/unity-setup@v4 | ||
with: | ||
version-file-path: 'test-project/**/ProjectSettings/ProjectVersion.txt' | ||
|
||
- 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 | ||
|
||
- name: Unity Build (${{ matrix.build-target }}) | ||
uses: xrtk/unity-action@refactor | ||
with: | ||
log-name: 'project-validation' | ||
args: '-quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' | ||
|
||
- uses: actions/upload-artifact@v3 | ||
name: Upload Artifacts | ||
if: always() | ||
with: | ||
name: '${{ runner.os }}-${{ matrix.build-target }}-Artifacts' | ||
path: '${{ env.UNITY_PROJECT_PATH }}/Builds' | ||
|
||
- name: Clean Artifacts | ||
if: always() | ||
run: | | ||
# Clean Artifacts | ||
$artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds" | ||
if (Test-Path -Path $artifacts) { | ||
Remove-Item $artifacts -Force -Recurse | ||
} | ||
shell: pwsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.cache/ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const {join} = require('path'); | ||
|
||
/** | ||
* @type {import("puppeteer").Configuration} | ||
*/ | ||
module.exports = { | ||
// Changes the cache location for Puppeteer. | ||
cacheDirectory: join(__dirname, '.cache', 'puppeteer'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,72 @@ | ||
# activeate-unity-license | ||
GitHub Action to activate unity license from secrets | ||
# 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)](https://github.com/XRTK) open source project. | ||
|
||
> This action does not require the use of XRTK in your Unity project. | ||
## Related Github Actions | ||
|
||
* [xrtk/unity-setup](https://github.com/XRTK/unity-setup) Downloads and installs the unity editor. | ||
* [xrtk/unity-action](https://github.com/XRTK/unity-action) An cli tool for passing commands to the Unity Engine. | ||
* [xrtk/unity-build](https://github.com/XRTK/unity-build) ***(Requires XRTK plugin in Unity Project)*** | ||
|
||
## 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]( | ||
https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks) | ||
|
||
[](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/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` (Required for pro/plus activations) | ||
|
||
> Don't forget that pro/plus licenses only support 2 active licenses at a time! | ||
### Create Workflow file | ||
|
||
```yml | ||
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-target: StandaloneLinux64 | ||
- os: windows-latest | ||
build-target: StandaloneWindows64 | ||
- os: macos-latest | ||
build-target: StandaloneOSX | ||
|
||
steps: | ||
- name: checkout self | ||
uses: actions/checkout@v3 | ||
|
||
# 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@v4 | ||
|
||
# Activates the installation with the provided credentials | ||
- uses: xrtk/activate-unity-license@v1 | ||
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 | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: 'Unity License Activation (XRTK)' | ||
description: 'Runs Unity with the provided options' | ||
branding: | ||
icon: 'at-sign' | ||
color: 'blue' | ||
inputs: | ||
username: | ||
description: 'Unity Username' | ||
required: true | ||
default: '' | ||
password: | ||
description: 'Unity Password' | ||
required: true | ||
default: '' | ||
license-type: | ||
description: 'License type to activate (professional or personal)' | ||
required: false | ||
default: 'Personal' | ||
serial: | ||
description: 'Unity Serial (Only used for Professional license type)' | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'node16' | ||
main: 'dist/index.js' | ||
post: 'dist/index.js' |
Oops, something went wrong.