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

pull/596/head
Andrew Kahr 2023-11-14 16:31:49 -08:00
parent caa0a81b47
commit e315ddedca
6 changed files with 17 additions and 13 deletions

4
dist/index.js generated vendored
View File

@ -5899,7 +5899,7 @@ const node_path_1 = __importDefault(__nccwpck_require__(49411));
class Docker {
static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [],
// eslint-disable-next-line unicorn/no-useless-undefined
options = undefined, entrypointBash = false, errorWhenMissingUnityBuildResults = true) {
options = undefined, entrypointBash = false, errorWhenMissingUnityBuildResults = false) {
let runCommand = '';
switch (process.platform) {
case 'linux':
@ -6024,7 +6024,7 @@ exports["default"] = ValidationError;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.execWithErrorCheck = void 0;
const exec_1 = __nccwpck_require__(71514);
async function execWithErrorCheck(commandLine, arguments_, options, errorWhenMissingUnityBuildResults = true) {
async function execWithErrorCheck(commandLine, arguments_, options, errorWhenMissingUnityBuildResults = false) {
const result = await (0, exec_1.getExecOutput)(commandLine, arguments_, options);
if (!errorWhenMissingUnityBuildResults) {
return result.exitCode;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -169,13 +169,15 @@ while (!$process.HasExited) {
Start-Sleep -Seconds 10
Get-Process
$BUILD_EXIT_CODE = $process.ExitCode
# Display results
if ($process.ExitCode -eq 0)
if ($BUILD_EXIT_CODE -eq 0)
{
Write-Output "Build Succeeded!!"
} else
{
Write-Output "$('Build failed, with exit code ')$($process.ExitCode)$('"')"
Write-Output "$('Build failed, with exit code ')$($BUILD_EXIT_CODE)$('"')"
}
Write-Output ""
@ -187,7 +189,7 @@ while (!$process.HasExited) {
Get-ChildItem $Env:BUILD_PATH_FULL
Write-Output ""
exit $process.ExitCode
break
}
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 }
# Setup Git Credentials
& "c:\steps\set_gitcredential.ps1"
. "c:\steps\set_gitcredential.ps1"
# Activate Unity
& "c:\steps\activate.ps1"
. "c:\steps\activate.ps1"
# Build the project
& "c:\steps\build.ps1"
. "c:\steps\build.ps1"
# Free the seat for the activated license
& "c:\steps\return_license.ps1"
. "c:\steps\return_license.ps1"
Start-Sleep -Seconds 3
Get-Process
exit $BUILD_EXIT_CODE

View File

@ -15,7 +15,7 @@ class Docker {
// eslint-disable-next-line unicorn/no-useless-undefined
options: ExecOptions | undefined = undefined,
entrypointBash: boolean = false,
errorWhenMissingUnityBuildResults: boolean = true,
errorWhenMissingUnityBuildResults: boolean = false,
) {
let runCommand = '';
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(
commandLine: string,
arguments_?: string[],
options?: ExecOptions,
errorWhenMissingUnityBuildResults: boolean = true,
errorWhenMissingUnityBuildResults: boolean = false,
): Promise<number> {
const result = await getExecOutput(commandLine, arguments_, options);