Merge branch 'main' into cloud-runner-develop

# Conflicts:
#	dist/index.js.map
This commit is contained in:
Frostebite 2024-01-27 01:38:58 +00:00
commit 71f94af18c
17 changed files with 154 additions and 58 deletions

View File

@ -12,6 +12,9 @@
#### Successful Workflow Run Link #### Successful Workflow Run Link
PRs don't have access to secrets so you will need to provide a link to a successful run of the workflows from your own
repo.
- ... - ...
#### Checklist #### Checklist

View File

@ -37,7 +37,7 @@ jobs:
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v3 - uses: actions/cache@v4
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }}
@ -61,6 +61,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -71,8 +72,8 @@ jobs:
########################### ###########################
# Upload # # Upload #
########################### ###########################
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: Build MacOS (${{ matrix.unityVersion }}) name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})
path: build path: build
retention-days: 14 retention-days: 14

View File

@ -69,7 +69,7 @@ jobs:
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v3 - uses: actions/cache@v4
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-ubuntu-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-ubuntu-${{ matrix.targetPlatform }}
@ -88,6 +88,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -108,6 +109,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -128,6 +130,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -138,8 +141,8 @@ jobs:
########################### ###########################
# Upload # # Upload #
########################### ###########################
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: Build Ubuntu (${{ matrix.unityVersion }}) name: Build ${{ matrix.targetPlatform }} on Ubuntu (${{ matrix.unityVersion }})
path: build path: build
retention-days: 14 retention-days: 14

View File

@ -39,7 +39,7 @@ jobs:
########################### ###########################
# Cache # # Cache #
########################### ###########################
- uses: actions/cache@v3 - uses: actions/cache@v4
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-windows-${{ matrix.targetPlatform }} key: Library-${{ matrix.projectPath }}-windows-${{ matrix.targetPlatform }}
@ -67,6 +67,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -90,6 +91,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -112,6 +114,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with: with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
@ -122,8 +125,8 @@ jobs:
########################### ###########################
# Upload # # Upload #
########################### ###########################
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: Build Windows (${{ matrix.unityVersion }}) name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})
path: build path: build
retention-days: 14 retention-days: 14

View File

@ -270,5 +270,5 @@ branding:
icon: 'box' icon: 'box'
color: 'gray-dark' color: 'gray-dark'
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'

Binary file not shown.

BIN
dist/index.js generated vendored

Binary file not shown.

View File

@ -129,7 +129,7 @@ echo ""
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \ /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \
-logFile - \ -logFile - \
-quit \ $( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
-batchmode \ -batchmode \
-nographics \ -nographics \
-username "$UNITY_EMAIL" \ -username "$UNITY_EMAIL" \

View File

@ -84,11 +84,12 @@ else
# #
echo "License activation strategy could not be determined." echo "License activation strategy could not be determined."
echo "" echo ""
echo "Visit https://game.ci/docs/github/getting-started for more" echo "Visit https://game.ci/docs/github/activation for more"
echo "details on how to set up one of the possible activation strategies." echo "details on how to set up one of the possible activation strategies."
echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \ echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \
or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER." or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER. See more info at https://game.ci/docs/github/activation"
# Immediately exit as no UNITY_EXIT_CODE can be derived. # Immediately exit as no UNITY_EXIT_CODE can be derived.
exit 1; exit 1;
@ -107,6 +108,3 @@ else
echo "::error ::There was an error while trying to activate the Unity license." echo "::error ::There was an error while trying to activate the Unity license."
exit $UNITY_EXIT_CODE exit $UNITY_EXIT_CODE
fi fi
# Return to previous working directory
popd

View File

@ -1,11 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Run in ACTIVATE_LICENSE_PATH directory if [[ -n "$UNITY_LICENSING_SERVER" ]]; then
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
pushd "$ACTIVATE_LICENSE_PATH"
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then #
# #
# Return any floating license used. # Return any floating license used.
# #
@ -25,6 +20,3 @@ elif [[ -n "$UNITY_SERIAL" ]]; then
-password "$UNITY_PASSWORD" \ -password "$UNITY_PASSWORD" \
-projectPath "/BlankProject" -projectPath "/BlankProject"
fi fi
# Return to previous working directory
popd

View File

@ -6,11 +6,64 @@ Write-Output "# Activating #"
Write-Output "###########################" Write-Output "###########################"
Write-Output "" Write-Output ""
& "$Env:UNITY_PATH/Editor/Unity.exe" -batchmode -quit -nographics ` if ( ($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($null -ne ${env:UNITY_PASSWORD}) )
{
#
# SERIAL LICENSE MODE
#
# This will activate unity, using the serial activation process.
#
Write-Output "Requesting activation"
$ACTIVATION_OUTPUT = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
-NoNewWindow `
-PassThru `
-ArgumentList "-batchmode `
-quit `
-nographics `
-username $Env:UNITY_EMAIL ` -username $Env:UNITY_EMAIL `
-password $Env:UNITY_PASSWORD ` -password $Env:UNITY_PASSWORD `
-serial $Env:UNITY_SERIAL ` -serial $Env:UNITY_SERIAL `
-projectPath "c:/BlankProject" ` -projectPath c:/BlankProject `
-logfile - | Out-Host -logfile -"
$ACTIVATION_EXIT_CODE = $LASTEXITCODE # Cache the handle so exit code works properly
# https://stackoverflow.com/questions/10262231/obtaining-exitcode-using-start-process-and-waitforexit-instead-of-wait
$unityHandle = $ACTIVATION_OUTPUT.Handle
while ($true) {
if ($ACTIVATION_OUTPUT.HasExited) {
$ACTIVATION_EXIT_CODE = $ACTIVATION_OUTPUT.ExitCode
# Display results
if ($ACTIVATION_EXIT_CODE -eq 0)
{
Write-Output "Activation Succeeded"
} else
{
Write-Output "Activation failed, with exit code $ACTIVATION_EXIT_CODE"
}
break
}
Start-Sleep -Seconds 3
}
}
else
{
#
# NO LICENSE ACTIVATION STRATEGY MATCHED
#
# This will exit since no activation strategies could be matched.
#
Write-Output "License activation strategy could not be determined."
Write-Output ""
Write-Output "Visit https://game.ci/docs/github/activation for more"
Write-Output "details on how to set up one of the possible activation strategies."
Write-Output "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \
or UNITY_LICENSE. See more info at https://game.ci/docs/github/activation"
$ACTIVATION_EXIT_CODE = 1;
}

View File

@ -137,26 +137,27 @@ $unityArgs = @(
"-batchmode", "-batchmode",
"-nographics", "-nographics",
"-silent-crashes", "-silent-crashes",
"-projectPath", $Env:UNITY_PROJECT_PATH, "-customBuildName", "`"$Env:BUILD_NAME`"",
"-executeMethod", $Env:BUILD_METHOD, "-projectPath", "`"$Env:UNITY_PROJECT_PATH`"",
"-buildTarget", $Env:BUILD_TARGET, "-executeMethod", "`"$Env:BUILD_METHOD`"",
"-customBuildTarget", $Env:BUILD_TARGET, "-buildTarget", "`"$Env:BUILD_TARGET`"",
"-customBuildPath", $Env:CUSTOM_BUILD_PATH, "-customBuildTarget", "`"$Env:BUILD_TARGET`"",
"-buildVersion", $Env:VERSION, "-customBuildPath", "`"$Env:CUSTOM_BUILD_PATH`"",
"-androidVersionCode", $Env:ANDROID_VERSION_CODE, "-buildVersion", "`"$Env:VERSION`"",
"-androidKeystorePass", $Env:ANDROID_KEYSTORE_PASS, "-androidVersionCode", "`"$Env:ANDROID_VERSION_CODE`"",
"-androidKeyaliasName", $Env:ANDROID_KEYALIAS_NAME, "-androidKeystorePass", "`"$Env:ANDROID_KEYSTORE_PASS`"",
"-androidKeyaliasPass", $Env:ANDROID_KEYALIAS_PASS, "-androidKeyaliasName", "`"$Env:ANDROID_KEYALIAS_NAME`"",
"-androidTargetSdkVersion", $Env:ANDROID_TARGET_SDK_VERSION, "-androidKeyaliasPass", "`"$Env:ANDROID_KEYALIAS_PASS`"",
"-androidExportType", $Env:ANDROID_EXPORT_TYPE, "-androidTargetSdkVersion", "`"$Env:ANDROID_TARGET_SDK_VERSION`"",
"-androidSymbolType", $Env:ANDROID_SYMBOL_TYPE, "-androidExportType", "`"$Env:ANDROID_EXPORT_TYPE`"",
"-androidSymbolType", "`"$Env:ANDROID_SYMBOL_TYPE`"",
"-logfile", "-" "-logfile", "-"
) + $customParametersArray ) + $customParametersArray
# Remove null items as that will fail the Start-Process call # Remove null items as that will fail the Start-Process call
$unityArgs = $unityArgs | Where-Object { $_ -ne $null } $unityArgs = $unityArgs | Where-Object { $_ -ne $null }
$unityProcess = Start-Process -FilePath "$Env:UNITY_PATH\Editor\Unity.exe" ` $unityProcess = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
-ArgumentList $unityArgs ` -ArgumentList $unityArgs `
-PassThru ` -PassThru `
-NoNewWindow -NoNewWindow

View File

@ -6,9 +6,47 @@ Write-Output "# Return License #"
Write-Output "###########################" Write-Output "###########################"
Write-Output "" Write-Output ""
& "$Env:UNITY_PATH\Editor\Unity.exe" -batchmode -quit -nographics ` if (($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($null -ne ${env:UNITY_PASSWORD}))
{
#
# SERIAL LICENSE MODE
#
# This will return the license that is currently in use.
#
$RETURN_LICENSE_OUTPUT = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
-NoNewWindow `
-PassThru `
-ArgumentList "-batchmode `
-quit `
-nographics `
-username $Env:UNITY_EMAIL ` -username $Env:UNITY_EMAIL `
-password $Env:UNITY_PASSWORD ` -password $Env:UNITY_PASSWORD `
-returnlicense ` -returnlicense `
-projectPath "c:/BlankProject" ` -projectPath c:/BlankProject `
-logfile - | Out-Host -logfile -"
# Cache the handle so exit code works properly
# https://stackoverflow.com/questions/10262231/obtaining-exitcode-using-start-process-and-waitforexit-instead-of-wait
$unityHandle = $RETURN_LICENSE_OUTPUT.Handle
while ($true) {
if ($RETURN_LICENSE_OUTPUT.HasExited) {
$RETURN_LICENSE_EXIT_CODE = $RETURN_LICENSE_OUTPUT.ExitCode
# Display results
if ($RETURN_LICENSE_EXIT_CODE -eq 0)
{
Write-Output "License Return Succeeded"
} else
{
Write-Output "License Return failed, with exit code $RETURN_LICENSE_EXIT_CODE"
Write-Output "::warning ::License Return failed! If this is a Pro License you might need to manually `
free the seat in your Unity admin panel or you might run out of seats to activate with."
}
break
}
Start-Sleep -Seconds 3
}
}

View File

@ -1,4 +1,4 @@
if ([string]::IsNullOrEmpty($env:GIT_PRIVATE_TOKEN)) { if ($null -eq ${env:GIT_PRIVATE_TOKEN}) {
Write-Host "GIT_PRIVATE_TOKEN unset skipping" Write-Host "GIT_PRIVATE_TOKEN unset skipping"
} }
else { else {

View File

@ -21,6 +21,9 @@ class Docker {
break; break;
case 'win32': case 'win32':
runCommand = this.getWindowsCommand(image, parameters); runCommand = this.getWindowsCommand(image, parameters);
break;
default:
throw new Error(`Operation system, ${process.platform}, is not supported yet.`);
} }
options.silent = silent; options.silent = silent;

View File

@ -168,7 +168,7 @@ class ImageTag {
if (customImage) return customImage; if (customImage) return customImage;
return `${image}:${tag}`; // '0' here represents the docker repo version return `${image}:${tag}`;
} }
} }

View File

@ -187,6 +187,7 @@ class SetupMac {
process.env.ANDROID_SYMBOL_TYPE = buildParameters.androidSymbolType; process.env.ANDROID_SYMBOL_TYPE = buildParameters.androidSymbolType;
process.env.CUSTOM_PARAMETERS = buildParameters.customParameters; process.env.CUSTOM_PARAMETERS = buildParameters.customParameters;
process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo; process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;
process.env.MANUAL_EXIT = buildParameters.manualExit.toString();
} }
} }