diff --git a/.github/workflows/build-winuxcmd.yml b/.github/workflows/build-winuxcmd.yml index 16e81eb..f4dced4 100644 --- a/.github/workflows/build-winuxcmd.yml +++ b/.github/workflows/build-winuxcmd.yml @@ -137,7 +137,8 @@ jobs: -Generator Ninja ` -Arch ${{ matrix.package_arch }} ` -VsEnvScript "${{ steps.locate_vcvars.outputs.vcvars_path }}" ` - -IsccPath "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" + -IsccPath "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ` + -SkipBuild - name: Upload Installer Artifact if: github.ref_type == 'tag' diff --git a/scripts/build-installer.ps1 b/scripts/build-installer.ps1 index 6b9f75a..cf618d4 100644 --- a/scripts/build-installer.ps1 +++ b/scripts/build-installer.ps1 @@ -14,7 +14,8 @@ param( [string[]]$VsEnvArgs, [string]$StageDir, [string]$OutputDir, - [string]$IsccPath + [string]$IsccPath, + [switch]$SkipBuild ) $ErrorActionPreference = "Stop" @@ -72,26 +73,28 @@ $projectVersion = Get-ProjectVersion -ProjectRoot $rootPath $issPath = Join-Path $rootPath "packaging\winuxcmd.iss" $buildScript = Join-Path $rootPath "scripts\build-with-vs.ps1" -if (-not (Test-Path -LiteralPath $VsEnvScript)) { - throw "Visual Studio environment script not found: $VsEnvScript" -} - if (-not (Test-Path -LiteralPath $issPath)) { throw "Installer script not found: $issPath" } -if (-not (Test-Path -LiteralPath $buildScript)) { - throw "Build helper not found: $buildScript" -} +if (-not $SkipBuild) { + if (-not (Test-Path -LiteralPath $VsEnvScript)) { + throw "Visual Studio environment script not found: $VsEnvScript" + } -if ($null -eq $VsEnvArgs) { - $scriptName = Split-Path -Leaf $VsEnvScript - if ($scriptName -ieq "VsDevCmd.bat") { - $VsEnvArgs = @("-arch=$Arch") - } elseif ($scriptName -ieq "vcvarsall.bat") { - $VsEnvArgs = @($Arch) - } else { - $VsEnvArgs = @() + if (-not (Test-Path -LiteralPath $buildScript)) { + throw "Build helper not found: $buildScript" + } + + if ($null -eq $VsEnvArgs) { + $scriptName = Split-Path -Leaf $VsEnvScript + if ($scriptName -ieq "VsDevCmd.bat") { + $VsEnvArgs = @("-arch=$Arch") + } elseif ($scriptName -ieq "vcvarsall.bat") { + $VsEnvArgs = @($Arch) + } else { + $VsEnvArgs = @() + } } } @@ -109,27 +112,29 @@ Write-Host "Version: $projectVersion" Write-Host "Arch: $Arch" Write-Host "" -$buildScriptArgs = @( - "-NoProfile", - "-ExecutionPolicy", "Bypass", - "-File", $buildScript, - "-Root", $rootPath, - "-BuildDir", $BuildDir, - "-Target", "winuxcmd", - "-Configuration", $Configuration, - "-VsEnvScript", $VsEnvScript, - "-Arch", $Arch, - "-Generator", $Generator -) - -if ($VsEnvArgs.Count -gt 0) { - $buildScriptArgs += @("-VsEnvArgs") - $buildScriptArgs += $VsEnvArgs -} +if (-not $SkipBuild) { + $buildScriptArgs = @( + "-NoProfile", + "-ExecutionPolicy", "Bypass", + "-File", $buildScript, + "-Root", $rootPath, + "-BuildDir", $BuildDir, + "-Target", "winuxcmd", + "-Configuration", $Configuration, + "-VsEnvScript", $VsEnvScript, + "-Arch", $Arch, + "-Generator", $Generator + ) + + if ($VsEnvArgs.Count -gt 0) { + $buildScriptArgs += @("-VsEnvArgs") + $buildScriptArgs += $VsEnvArgs + } -& powershell @buildScriptArgs -if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE + & powershell @buildScriptArgs + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } } & cmake --install $buildPath --prefix $resolvedStagePath