From 702282bacdc8485754090e015656e13ad3641619 Mon Sep 17 00:00:00 2001 From: Webber Date: Sun, 24 Nov 2019 19:16:50 +0100 Subject: [PATCH] Simplify request flow, merge strategies --- .github/workflows/request.yml | 30 +++----------------- request-manual-activation-file/action.yml | 4 +-- request-manual-activation-file/entrypoint.sh | 24 ++++++++++------ 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/.github/workflows/request.yml b/.github/workflows/request.yml index 1a94b21..69f847c 100644 --- a/.github/workflows/request.yml +++ b/.github/workflows/request.yml @@ -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 }} diff --git a/request-manual-activation-file/action.yml b/request-manual-activation-file/action.yml index b0c26dd..33862d5 100644 --- a/request-manual-activation-file/action.yml +++ b/request-manual-activation-file/action.yml @@ -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' diff --git a/request-manual-activation-file/entrypoint.sh b/request-manual-activation-file/entrypoint.sh index aa66cc6..4291e5a 100644 --- a/request-manual-activation-file/entrypoint.sh +++ b/request-manual-activation-file/entrypoint.sh @@ -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."