-
Notifications
You must be signed in to change notification settings - Fork 19
/
Build.ps1
52 lines (39 loc) · 1.64 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
# SPDX-FileCopyrightText: Copyright Corsinvest Srl
# SPDX-License-Identifier: AGPL-3.0-only
[System.Console]::Clear();
Write-Output "
______ _ __
/ ____/___ __________(_)___ _ _____ _____/ /_
/ / / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / / (__ ) / / / / |/ / __(__ ) /_
\____/\____/_/ /____/_/_/ /_/|___/\___/____/\__/
(Made in Italy)
=========================================================
== Build System
========================================================="
#build documentation
.\doc-utils.ps1 build
$pathBasePrj = "..\src\Corsinvest.ProxmoxVE.Admin"
$pathBinRelase = "$pathBasePrj\Bin\Release\net8.0"
Remove-Item -Path ".\$pathBinRelase" -Recurse -Force
$fileName = "cv4pve-admin"
$rids = @("win-x64", "win-x86", "win-arm64", "linux-x64", "linux-arm", "linux-arm64", "osx-x64", "osx-arm64")
foreach ($rid in $rids) {
dotnet publish "$pathBasePrj\Corsinvest.ProxmoxVE.Admin.csproj" `
-r $rid `
-c Release `
--self-contained `
-p:PublishSingleFile=true `
-p:IncludeAllContentForSelfExtract=true
$path = "$pathBinRelase\$rid\publish"
#fix appsettings.json
Remove-Item "$path\appsettings.json"
Remove-Item "$path\appsettings.Development.json"
Remove-Item "$path\*.pdb"
Remove-Item "$path\libman.json"
#compress
$fileDest = "$pathBinRelase\$fileName-$rid.zip"
Remove-Item $fileDest -ErrorAction SilentlyContinue
Get-ChildItem -Path "$path\" | Compress-Archive -DestinationPath $fileDest
Remove-Item "$pathBinRelase\$rid" -Recurse -Force
}