Refactor request activation file action to follow good practices

This commit is contained in:
Webber
2019-11-23 13:32:32 +01:00
committed by Webber Takken
parent 1d8fe58325
commit 7ac35ecc6c
6 changed files with 38 additions and 24 deletions

View File

@@ -1,7 +0,0 @@
# Get manual license file
Acquires manual license file for activating CI license.
## Usage
Unknown so far

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -e
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-batchmode \
-nographics \
-logFile /dev/stdout \
-createManualActivationFile
echo "Use this file for manual activation and add it to \$UNITY_LICENSE variabe."
cat Unity_v2019.2.11f1.alf
cp Unity_v2019.2.11f1.alf $HOME/Unity_v2019.2.11f1.alf

View File

@@ -1,7 +1,7 @@
FROM gableroux/unity3d:2019.2.11f1
LABEL "com.github.actions.name"="Get Unity License File"
LABEL "com.github.actions.description"="Acquire manual license file for Unity editor"
LABEL "com.github.actions.name"="Request Unity Manual Activation File"
LABEL "com.github.actions.description"="Request the manual activation file for activating Unity personal"
LABEL "com.github.actions.icon"="box"
LABEL "com.github.actions.color"="gray-dark"

View File

@@ -0,0 +1,8 @@
# Get manual license file
Acquires manual activation file for activating CI license.
## Usage
Please refer to `.github/actions/request.yml` in this repo while the repo is
still a work in progress.

View File

@@ -0,0 +1,8 @@
name: 'Request manual activation file'
description: 'Request the manual activation file for activating Unity personal'
outputs:
activationFile:
description: 'Manual activation file'
runs:
using: 'docker'
image: 'Dockerfile'

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Request the manual activation file for activating unity personal
# Expected output file: "Unity_v${{ unity-tag }}.alf"
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-batchmode \
-nographics \
-logFile /dev/stdout \
-quit \
-createManualActivationFile
# Output the resulting file as an output variable (Strategy 1)
ACTIVATION_FILE=$(cat Unity_v2019.2.11f1.alf)
echo "Use this file for manual activation and add it to \$UNITY_LICENSE variabe."
echo "::add-mask::$ACTIVATION_FILE"
echo "::set-output name=activationFile::$ACTIVATION_FILE"
# Output the resulting file by copying (Strategy 2)
cp Unity_v2019.2.11f1.alf $HOME/Unity_v2019.2.11f1.alf