Update code for activation script

This commit is contained in:
Webber
2019-11-24 20:15:01 +01:00
committed by Webber Takken
parent 702282bacd
commit bd43fe9017
5 changed files with 55 additions and 2 deletions

25
.github/workflows/main.yml vendored Normal file
View 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 }}

View File

@@ -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"

View 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'

View File

@@ -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 \