-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmake.ps1
52 lines (39 loc) · 1.35 KB
/
make.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
$jobs = @()
$apps = @("BrowseRouter")
$rids = @("win-x64", "win-arm64")
$version = & ./Get-ProjectVersion.ps1 BrowseRouter
$certTmpPath = "cert.tmp.crt"
& ./Decode-FromBase64.ps1 $env:ENDURABYTE_WINDOWS_CODE_SIGN_CERTIFICATE $certTmpPath
$certTmpPath = "$PSScriptRoot/$certTmpPath"
foreach ($app in $apps) {
echo "Packing $app..."
$job = Start-ThreadJob {
# Create thread-local copies of these variables
$certTmpPath = $using:certTmpPath
$app = $using:app
& {
pushd $app
& ../Publish-And-Sign.ps1 "$app.exe" $certTmpPath
popd
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
# Redirect all output (including stdout and stderr) to the main thread
# so it appears in the console and in CI build logs
} *>&1 | ForEach-Object { "[$app] $_" } | Out-Host
} -StreamingHost $Host
# Add the job to the list
$jobs += $job
}
# Wait for all jobs to complete
Wait-Job -Job $jobs
rm $certTmpPath
# Create release zip files
foreach ($rid in $rids) {
$outDir = "./Releases/$version/$rid"
md $outDir -ea 0
cp ./BrowseRouter/publish/$rid/BrowseRouter.exe $outDir
cp ./BrowseRouter/publish/$rid/config.ini $outDir
$zipPath = "$outDir/BrowseRouter-$rid.zip"
Compress-Archive -Path "$outDir/*" -DestinationPath $zipPath -Force
}