-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
69 lines (60 loc) · 2 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
param(
[Parameter(Mandatory = $true)]
[ValidateSet("windows", "windows-cublas", "linux", "linux-cublas", "macos", "macos-metal")]
[string]$BuildPlatform,
[Parameter(Mandatory = $false)]
[switch]$Force,
[Parameter(Mandatory = $false)]
[switch]$SkipDeployment,
[Parameter(Mandatory = $false)]
[switch]$SkipNpmInstall
)
Push-Location -Path $PSScriptRoot
try {
Write-Host "Starting build for Wingman on platform: $BuildPlatform"
# Build Wingman UX
Write-Host "Building Wingman UX"
Push-Location -Path "./ux"
./build-ux-ci.ps1 -BuildPlatform $BuildPlatform -Force:$Force -SkipNpmInstall:$SkipNpmInstall
if ($LASTEXITCODE -ne 0) {
throw "Building Wingman UX failed with exit code $LASTEXITCODE"
}
Pop-Location
# Build Wingman Admin UX
Write-Host "Building Wingman Admin UX"
Push-Location -Path "./admin"
./build-ux-ci.ps1 -BuildPlatform $BuildPlatform -Force:$Force -SkipNpmInstall:$SkipNpmInstall
if ($LASTEXITCODE -ne 0) {
throw "Building Wingman Admin UX failed with exit code $LASTEXITCODE"
}
Pop-Location
# Build Wingman.cpp
Write-Host "Building Wingman.cpp"
Push-Location -Path "./services/wingman.cpp"
./build-wingman-ci.ps1 -BuildPlatform $BuildPlatform -Force:$Force
if ($LASTEXITCODE -ne 0) {
throw "Building Wingman.cpp failed with exit code $LASTEXITCODE"
}
Pop-Location
# Build Wingman UX
if ($SkipDeployment) {
Write-Warning "Skipping deployment..."
}
else {
Write-Host "Deploying Wingman Desktop ..."
Push-Location -Path "./ux"
./deploy-ux-ci.ps1 -BuildPlatform $BuildPlatform -SkipBuild -SkipDeployment:$SkipDeployment
if ($LASTEXITCODE -ne 0) {
throw "Deploying Wingman failed with exit code $LASTEXITCODE"
}
Pop-Location
}
Write-Host "Build complete successfully"
}
catch {
Write-Error "An error occurred during the build process: $_"
exit 1
}
finally {
Pop-Location
}