Switch to dot sourcing for windows, pass exit code out and disable error parsing

This commit is contained in:
Andrew Kahr 2023-11-14 16:31:49 -08:00
parent caa0a81b47
commit e315ddedca
6 changed files with 14 additions and 10 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -169,13 +169,15 @@ while (!$process.HasExited) {
Start-Sleep -Seconds 10 Start-Sleep -Seconds 10
Get-Process Get-Process
$BUILD_EXIT_CODE = $process.ExitCode
# Display results # Display results
if ($process.ExitCode -eq 0) if ($BUILD_EXIT_CODE -eq 0)
{ {
Write-Output "Build Succeeded!!" Write-Output "Build Succeeded!!"
} else } else
{ {
Write-Output "$('Build failed, with exit code ')$($process.ExitCode)$('"')" Write-Output "$('Build failed, with exit code ')$($BUILD_EXIT_CODE)$('"')"
} }
Write-Output "" Write-Output ""
@ -187,7 +189,7 @@ while (!$process.HasExited) {
Get-ChildItem $Env:BUILD_PATH_FULL Get-ChildItem $Env:BUILD_PATH_FULL
Write-Output "" Write-Output ""
exit $process.ExitCode break
} }
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5

View File

@ -12,16 +12,18 @@ regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.
Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force } Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force }
# Setup Git Credentials # Setup Git Credentials
& "c:\steps\set_gitcredential.ps1" . "c:\steps\set_gitcredential.ps1"
# Activate Unity # Activate Unity
& "c:\steps\activate.ps1" . "c:\steps\activate.ps1"
# Build the project # Build the project
& "c:\steps\build.ps1" . "c:\steps\build.ps1"
# Free the seat for the activated license # Free the seat for the activated license
& "c:\steps\return_license.ps1" . "c:\steps\return_license.ps1"
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
Get-Process Get-Process
exit $BUILD_EXIT_CODE

View File

@ -15,7 +15,7 @@ class Docker {
// eslint-disable-next-line unicorn/no-useless-undefined // eslint-disable-next-line unicorn/no-useless-undefined
options: ExecOptions | undefined = undefined, options: ExecOptions | undefined = undefined,
entrypointBash: boolean = false, entrypointBash: boolean = false,
errorWhenMissingUnityBuildResults: boolean = true, errorWhenMissingUnityBuildResults: boolean = false,
) { ) {
let runCommand = ''; let runCommand = '';
switch (process.platform) { switch (process.platform) {

View File

@ -1,10 +1,10 @@
import { getExecOutput, ExecOptions } from '@actions/exec'; import { ExecOptions, getExecOutput } from '@actions/exec';
export async function execWithErrorCheck( export async function execWithErrorCheck(
commandLine: string, commandLine: string,
arguments_?: string[], arguments_?: string[],
options?: ExecOptions, options?: ExecOptions,
errorWhenMissingUnityBuildResults: boolean = true, errorWhenMissingUnityBuildResults: boolean = false,
): Promise<number> { ): Promise<number> {
const result = await getExecOutput(commandLine, arguments_, options); const result = await getExecOutput(commandLine, arguments_, options);