Simplify request flow, merge strategies

This commit is contained in:
Webber
2019-11-24 19:16:50 +01:00
committed by Webber Takken
parent 34352bdba5
commit 702282bacd
3 changed files with 21 additions and 37 deletions

View File

@@ -18,34 +18,12 @@ jobs:
# Configure request manual activation file action
- name: Request manual activation file
id: getManualLicenseFile
uses: ./request-manual-activation-file
# uses: actions/webbertakken/request-manual-activation-file@master
##
## Strategy 1: Use the output from the jobs output variable
##
# TODO - Fix quotes in this file
# Save output from variable as ManualActivationFile.alf
- name: Save variable as file
run: printf "%s" "${{ steps.getManualLicenseFile.outputs.activationFile }}" > ManualActivationFile.alf
id: getManualLicenseFile
# Upload artifact
- name: Expose as artifact (Strategy 1 - by passed variable)
- name: Expose as artifact
uses: actions/upload-artifact@v1
with:
name: ManualActivationFile.alf
path: ManualActivationFile.alf
##
## Strategy 2: Use the output file directly
##
# Upload artifact
- name: Expose as artifact (Strategy 2 - by copied file)
uses: actions/upload-artifact@v1
with:
name: Unity_v${{ matrix.unity-tag }}.alf
path: Unity_v${{ matrix.unity-tag }}.alf
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}

View File

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

View File

@@ -1,7 +1,13 @@
#!/usr/bin/env bash
# The container's unity version
UNITY_VERSION=2019.2.11f1
# Determine the expected file name and path
FILE_NAME=Unity_v$UNITY_VERSION.alf
FILE_PATH=$FILE_NAME
# 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 \
@@ -10,12 +16,12 @@ xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
-quit \
-createManualActivationFile
# Output the resulting file as an output variable (Strategy 1)
ACTIVATION_FILE=$(cat Unity_v2019.2.11f1.alf)
echo $ACTIVATION_FILE
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
cp $FILE_NAME $HOME/$FILE_PATH
# Output the resulting file by copying (Strategy 2)
cp Unity_v2019.2.11f1.alf $HOME/Unity_v2019.2.11f1.alf
# Set resulting name as output variable
echo ::set-output name=filePath::$FILE_PATH
# Explain what to do next
echo "Use the file \"$FILE_PATH\" for manual activation."
echo "Set the contents of the resulting license file as the \$UNITY_LICENSE variabe."