mirror of
https://github.com/game-ci/unity-actions.git
synced 2026-01-29 04:39:07 +08:00
Update code for activation script
This commit is contained in:
25
.github/workflows/main.yml
vendored
Normal file
25
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
testWorkflowActions:
|
||||
runs-on: ubuntu-latest
|
||||
name: Test the workflow actions
|
||||
|
||||
# Set Unity version
|
||||
strategy:
|
||||
matrix:
|
||||
unity-tag: [2019.2.11f1] # TODO - Reference this tag in all steps
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout repository (required to test local actions)
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
|
||||
# Configure generic activation (local to the actions container)
|
||||
- name: Request activation
|
||||
uses: ./request-activation
|
||||
inputs:
|
||||
args:
|
||||
unityLicense: ${{ secrets.UNITY_LICENSE }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM gableroux/unity3d:2019.2.11f1-webgl
|
||||
FROM gableroux/unity3d:2019.2.11f1
|
||||
|
||||
LABEL "com.github.actions.name"="Activate Unity"
|
||||
LABEL "com.github.actions.description"="Activate license for Unity editor"
|
||||
8
request-activation/action.yml
Normal file
8
request-activation/action.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
name: 'Request activation'
|
||||
description: 'Request activation using credentials or license file'
|
||||
inputs:
|
||||
unityLicense:
|
||||
description: 'Unity License for activating Unity Personal'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
@@ -15,7 +15,25 @@ if [[ ! -z "$UNITY_LICENSE" ]]; then
|
||||
# * Windows: C:/ProgramData/Unity/Unity_lic.ulf
|
||||
# * MacOS: /Library/Application Support/Unity/Unity_lic.ulf
|
||||
#
|
||||
echo "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf
|
||||
|
||||
# Set the license file path
|
||||
FILE_PATH=UnityLicenseFile.ulf
|
||||
|
||||
# Copy license file from Github variables
|
||||
echo "$UNITY_LICENSE" > $FILE_PATH
|
||||
# echo "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf
|
||||
|
||||
# Activate container
|
||||
# See: https://docs.unity3d.com/Manual/CommandLineArguments.html
|
||||
echo "Activating Unity"
|
||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||
/opt/Unity/Editor/Unity \
|
||||
-batchmode \
|
||||
-nographics \
|
||||
-logFile /dev/stdout \
|
||||
-quit \
|
||||
-manualLicenseFile Unity_v2019.2.11f1.ulf
|
||||
|
||||
else
|
||||
#
|
||||
# PROFESSIONAL (SERIAL) LICENSE MODE
|
||||
@@ -24,6 +42,8 @@ else
|
||||
#
|
||||
# Note: This is the preferred way for PROFESSIONAL LICENSES.
|
||||
#
|
||||
# TODO - Verify this using some pro license
|
||||
#
|
||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||
/opt/Unity/Editor/Unity \
|
||||
-logFile /dev/stdout \
|
||||
Reference in New Issue
Block a user