diff --git a/.azure/post-build.ps1 b/.azure/post-build.ps1 index ddb41e4b..3ac820f1 100644 --- a/.azure/post-build.ps1 +++ b/.azure/post-build.ps1 @@ -11,9 +11,17 @@ param ( Set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' +# Root directory of the project. +$RootDir = Split-Path $PSScriptRoot -Parent +$BuildDir = Join-Path $RootDir "build" + +if (!(Test-Path $BuildDir)) { + New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null +} + function Execute([String]$Name, [String]$Arguments) { Write-Debug "$Name $Arguments" - $process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory "./build" + $process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory $BuildDir $handle = $process.Handle # Magic work around. Don't remove this line. $process.WaitForExit(); if ($process.ExitCode -ne 0) { diff --git a/.azure/pre-build.ps1 b/.azure/pre-build.ps1 index df56d217..423cd228 100644 --- a/.azure/pre-build.ps1 +++ b/.azure/pre-build.ps1 @@ -19,9 +19,17 @@ param ( Set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' +# Root directory of the project. +$RootDir = Split-Path $PSScriptRoot -Parent +$BuildDir = Join-Path $RootDir "build" + +if (!(Test-Path $BuildDir)) { + New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null +} + function Execute([String]$Name, [String]$Arguments) { Write-Debug "$Name $Arguments" - $process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory "./build" + $process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory $BuildDir $handle = $process.Handle # Magic work around. Don't remove this line. $process.WaitForExit(); if ($process.ExitCode -ne 0) { @@ -36,10 +44,6 @@ if ($env:ONEBRANCH_CONFIG) { $Config = $env:ONEBRANCH_CONFIG } -if (!(Test-Path "./build")) { - New-Item -Path "./build" -ItemType Directory -Force | Out-Null -} - $_Arch = $Arch if ($_Arch -eq "x86") { $_Arch = "Win32" } diff --git a/.github/workflows/onebranch.yml b/.github/workflows/onebranch.yml index dfeec9d4..53b19e8f 100644 --- a/.github/workflows/onebranch.yml +++ b/.github/workflows/onebranch.yml @@ -1,4 +1,4 @@ -name: Build +name: OneBranch-Style Build on: push: