diff --git a/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 b/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 index d4f837b52b..50d8789d26 100644 --- a/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 +++ b/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 @@ -12,6 +12,8 @@ param( [string] $BuildOption = "" ) +# Fail early on all errors +$ErrorActionPreference = "Stop" ################### ### PROCEDURE ### @@ -20,13 +22,26 @@ param( echo "Install Qt..." # Install Qt pip install aqtinstall +if ( !$? ) +{ + throw "pip install aqtinstall failed with exit code $LastExitCode" +} + echo "Get Qt 64 bit..." # intermediate solution if the main server is down: append e.g. " -b https://mirrors.ocf.berkeley.edu/qt/" to the "aqt"-line below aqt install --outputdir C:\Qt 5.15.2 windows desktop win64_msvc2019_64 +if ( !$? ) +{ + throw "64bit Qt installation failed with exit code $LastExitCode" +} echo "Get Qt 32 bit..." # intermediate solution if the main server is down: append e.g. " -b https://mirrors.ocf.berkeley.edu/qt/" to the "aqt"-line below aqt install --outputdir C:\Qt 5.15.2 windows desktop win32_msvc2019 +if ( !$? ) +{ + throw "32bit Qt installation failed with exit code $LastExitCode" +} ################################# @@ -38,9 +53,16 @@ if ($BuildOption -Eq "jackonwindows") echo "Install JACK2 64-bit..." # Install JACK2 64-bit choco install --no-progress -y jack + if ( !$? ) + { + throw "64bit jack installation failed with exit code $LastExitCode" + } echo "Install JACK2 32-bit..." # Install JACK2 32-bit (need to force choco install as it detects 64 bits as installed) choco install --no-progress -y -f --forcex86 jack + if ( !$? ) + { + throw "32bit jack installation failed with exit code $LastExitCode" + } } - diff --git a/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 b/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 index 84493d7823..b18394de1e 100644 --- a/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 +++ b/autobuild/windows/autobuild_windowsinstaller_2_build.ps1 @@ -2,7 +2,6 @@ # autobuild_2_build: actual build process - #################### ### PARAMETERS ### #################### @@ -12,11 +11,15 @@ param ( [string] $jamulus_project_path = $Env:jamulus_project_path, [string] $BuildOption = "" ) + +# Fail early on all errors +$ErrorActionPreference = "Stop" + # Sanity check of parameters if (("$jamulus_project_path" -eq $null) -or ("$jamulus_project_path" -eq "")) { throw "expecting ""jamulus_project_path"" as parameter or ENV" } elseif (!(Test-Path -Path $jamulus_project_path)) { - throw "non.existing jamulus_project_path: $jamulus_project_path" + throw "non-existing jamulus_project_path: $jamulus_project_path" } else { echo "jamulus_project_path is valid: $jamulus_project_path" } @@ -36,3 +39,7 @@ else { powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" } +if ( !$? ) +{ + throw "deploy_windows.ps1 failed with exit code $LastExitCode" +} diff --git a/autobuild/windows/autobuild_windowsinstaller_3_copy_files.ps1 b/autobuild/windows/autobuild_windowsinstaller_3_copy_files.ps1 index 67b2f15813..dabd6660c2 100644 --- a/autobuild/windows/autobuild_windowsinstaller_3_copy_files.ps1 +++ b/autobuild/windows/autobuild_windowsinstaller_3_copy_files.ps1 @@ -2,7 +2,6 @@ # autobuild_3_copy_files: copy the built files to deploy folder - #################### ### PARAMETERS ### #################### @@ -13,6 +12,10 @@ param ( [string] $jamulus_buildversionstring = $Env:jamulus_buildversionstring, [string] $BuildOption = "" ) + +# Fail early on all errors +$ErrorActionPreference = "Stop" + # Sanity check of parameters if (("$jamulus_project_path" -eq $null) -or ("$jamulus_project_path" -eq "")) { throw "expecting ""jamulus_project_path"" as parameter or ENV" @@ -38,8 +41,8 @@ switch ($BuildOption) ### PROCEDURE ### ################### -# Rename the file -echo "rename" +# Copy the file +echo "copy" if ($BuildOption -ne "") { $artifact_deploy_filename = "jamulus_${Env:jamulus_buildversionstring}_win_${BuildOption}.exe" @@ -49,8 +52,12 @@ else $artifact_deploy_filename = "jamulus_${Env:jamulus_buildversionstring}_win.exe" } -echo "rename deploy file to $artifact_deploy_filename" +echo "copying deploy file to $artifact_deploy_filename" cp "$jamulus_project_path\deploy\Jamulus*installer-win.exe" "$jamulus_project_path\deploy\$artifact_deploy_filename" +if ( !$? ) +{ + throw "cp failed with exit code $LastExitCode"; +} Function github_output_value diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index 4084f20e07..77190118e2 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -1,4 +1,4 @@ -param( +param ( # Replace default path with system Qt installation folder if necessary [string] $QtInstallPath = "C:\Qt\5.15.2", [string] $QtCompile32 = "msvc2019", @@ -10,6 +10,9 @@ param( [string] $BuildOption = "" ) +# Fail early on all errors +$ErrorActionPreference = "Stop" + # change directory to the directory above (if needed) Set-Location -Path "$PSScriptRoot\..\" @@ -20,10 +23,6 @@ $DeployPath = "$RootPath\deploy" $WindowsPath ="$RootPath\windows" $AppName = "Jamulus" -# Stop at all errors -$ErrorActionPreference = "Stop" - - # Execute native command with errorlevel handling Function Invoke-Native-Command { param(