forked from jexuswebserver/JexusManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.ps1
More file actions
53 lines (47 loc) · 1.75 KB
/
release.ps1
File metadata and controls
53 lines (47 loc) · 1.75 KB
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
$msBuild = "msbuild"
try
{
& $msBuild /version
Write-Host "Likely on Linux/macOS."
}
catch
{
Write-Host "MSBuild doesn't exist. Use VSSetup instead."
Install-Module VSSetup -Scope CurrentUser -Force
$instance = Get-VSSetupInstance -All | Select-VSSetupInstance -Latest
$installDir = $instance.installationPath
$msBuild = $installDir + '\MSBuild\Current\Bin\MSBuild.exe'
if (![System.IO.File]::Exists($msBuild))
{
Write-Host "MSBuild 16 doesn't exist."
$msBuild = $installDir + '\MSBuild\15.0\Bin\MSBuild.exe'
if (![System.IO.File]::Exists($msBuild))
{
Write-Host "MSBuild 15 doesn't exist. Exit."
exit 1
}
else
{
Write-Host "Likely on Windows with VS2017."
}
}
else
{
Write-Host "Likely on Windows with VS2019."
}
}
Write-Host "MSBuild found. Compile the projects."
& $msBuild JexusManager.sln /p:Configuration=Release /t:restore
& $msBuild JexusManager.sln /p:Configuration=Release /t:clean
Remove-Item .\bin -Recurse
New-Item .\bin -ItemType Directory
Set-Location .\JexusManager
dotnet publish -c Release -r win-x64 /p:PublishSignelFile=true -o ..\bin\x64 /p:PublishSingleFile=true /p:PublishTrimmed=true
dotnet publish -c Release -r win-x86 /p:PublishSignelFile=true -o ..\bin\x86 /p:PublishSingleFile=true /p:PublishTrimmed=true
Copy-Item .\ThirdPartyNotices.txt ..\bin
Set-Location ..
Set-Location .\CertificateInstaller
dotnet publish -c Release -r win-x64 /p:PublishSignelFile=true -o ..\bin\x64 /p:PublishSingleFile=true /p:PublishTrimmed=true
dotnet publish -c Release -r win-x86 /p:PublishSignelFile=true -o ..\bin\x86 /p:PublishSingleFile=true /p:PublishTrimmed=true
Set-Location ..
Write-Host "Compilation finished."