Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-winuxcmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
77 changes: 41 additions & 36 deletions scripts/build-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ param(
[string[]]$VsEnvArgs,
[string]$StageDir,
[string]$OutputDir,
[string]$IsccPath
[string]$IsccPath,
[switch]$SkipBuild
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -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 = @()
}
}
}

Expand All @@ -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
Expand Down
Loading