-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPublish.ps1
More file actions
112 lines (88 loc) · 2.83 KB
/
Publish.ps1
File metadata and controls
112 lines (88 loc) · 2.83 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
function Publish-DotNetApp {
param (
[string[]]$publishArgs,
[string]$projectPath,
[string]$oldName,
[string]$newName
)
Write-Host "Publishing $newName..."
$outputFile = ".\$newName"
if (Test-Path $outputFile) {
Remove-Item -Path $outputFile -Force
}
dotnet publish "$projectPath" -c Release -r win-x64 @publishArgs --output "." --nologo
Rename-Item -Path ".\$oldName" -NewName "$newName"
Write-Host "Successfully published $newName!"
}
function Publish-GoApp {
param (
[string]$projectPath,
[string]$outputName
)
Write-Host "Publishing $outputName..."
$outputFile = ".\$outputName"
if (Test-Path $outputFile) {
Remove-Item -Path $outputFile -Force
}
Push-Location $projectPath
go build -o "../$outputName"
Pop-Location
Write-Host "Successfully published $outputName!"
}
function Publish-RustApp {
param (
[string]$projectPath,
[string]$binaryName,
[string]$outputName
)
Write-Host "Publishing $outputName..."
$outputFile = ".\$outputName"
if (Test-Path $outputFile) {
Remove-Item -Path $outputFile -Force
}
Push-Location $projectPath
cargo build --release
Copy-Item -Path ".\target\release\$binaryName" -Destination "..\$outputName"
Pop-Location
Write-Host "Successfully published $outputName!"
}
Publish-DotNetApp `
-publishArgs @("--self-contained", "true", "/p:PublishSingleFile=true") `
-projectPath ".\DotNetWorkload" `
-oldName "DotNetWorkload.exe" `
-newName "DotNetWorkloadJitApp.exe"
Publish-DotNetApp `
-publishArgs @("--self-contained", "true", "/p:PublishSingleFile=true") `
-projectPath ".\DotNetLight" `
-oldName "DotNetLight.exe" `
-newName "DotNetLightJitApp.exe"
Publish-DotNetApp `
-publishArgs @("/p:PublishAot=true") `
-projectPath ".\DotNetWorkload" `
-oldName "DotNetWorkload.exe" `
-newName "DotNetWorkloadAotApp.exe"
Publish-DotNetApp `
-publishArgs @("/p:PublishAot=true") `
-projectPath ".\DotNetLight" `
-oldName "DotNetLight.exe" `
-newName "DotNetLightAotApp.exe"
Publish-GoApp `
-projectPath ".\GolangWorkload" `
-outputName "GolangWorkloadApp.exe"
Publish-GoApp `
-projectPath ".\GolangLight" `
-outputName "GolangLightApp.exe"
Publish-RustApp `
-projectPath ".\RustWorkload" `
-binaryName "RustWorkload.exe" `
-outputName "RustWorkloadApp.exe"
Publish-RustApp `
-projectPath ".\RustLight" `
-binaryName "RustLight.exe" `
-outputName "RustLightApp.exe"
Publish-DotNetApp `
-publishArgs @("--self-contained", "true", "/p:PublishSingleFile=true") `
-projectPath ".\PerformanceProfiler" `
-oldName "PerformanceProfiler.exe" `
-newName "PerformanceProfilerApp.exe"
Write-Host "All builds completed successfully!"