-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.ps1
76 lines (66 loc) · 5.15 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
70
71
72
73
74
75
76
param(
[parameter(Mandatory=$false)]
[String]$v
)
$version="0.6.0"
if($PSBoundParameters.ContainsKey("v") -and $v.Length -gt 0){
$version = $v.TrimStart("v");
}
Write-Host "Building version ${version}"
cd Benchmarker
if([System.IO.Directory]::Exists("bin/Release")){
Remove-Item -Path bin/Release -Recurse
}
mkdir bin/Release
dotnet restore Benchmarker.csproj
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -o bin/Release/Benchmarker /p:VersionSuffix=$version
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r win-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-win64 /p:Version=$version-win64
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r win-x86 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-win32 /p:Version=$version-win86
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r linux-arm /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-linux-arm32v7 /p:Version=$version-linuxarm
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r win-arm /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-win-arm32v7 /p:Version=$version-winarm
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r win-arm64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-win-arm64 /p:Version=$version-winarm64
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r linux-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-linux64 /p:Version=$version-linux64
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r debian-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-debian64 /p:Version=$version-debain64
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r ubuntu-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-ubuntu64 /p:Version=$version-ubuntu64
dotnet publish Benchmarker.csproj --framework netcoreapp3.0 -c Release -r osx-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true -o bin/Release/Benchmarker-osx64 /p:Version=$version-osx64
Copy-Item ../Readme.md bin/Release/Benchmarker/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-win64/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-win32/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-linux-arm32v7/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-win-arm32v7/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-win-arm64/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-linux64/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-debian64/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-ubuntu64/README.md
Copy-Item ../Readme.md bin/Release/Benchmarker-osx64/README.md
Copy-Item ../LICENSE bin/Release/Benchmarker/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-win64/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-win32/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-linux-arm32v7/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-win-arm32v7/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-win-arm64/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-linux64/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-debian64/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-ubuntu64/LICENSE
Copy-Item ../LICENSE bin/Release/Benchmarker-osx64/LICENSE
mkdir bin/Release/ZIPs
Compress-Archive -Path bin/Release/Benchmarker -DestinationPath bin/Release/ZIPs/Benchmarker.zip
Compress-Archive -Path bin/Release/Benchmarker-win64 -DestinationPath bin/Release/ZIPs/Benchmarker-win64.zip
Compress-Archive -Path bin/Release/Benchmarker-win32 -DestinationPath bin/Release/ZIPs/Benchmarker-win32.zip
Compress-Archive -Path bin/Release/Benchmarker-linux-arm32v7 -DestinationPath bin/Release/ZIPs/Benchmarker-linux-arm32v7.zip
Compress-Archive -Path bin/Release/Benchmarker-win-arm32v7 -DestinationPath bin/Release/ZIPs/Benchmarker-win-arm32v7.zip
Compress-Archive -Path bin/Release/Benchmarker-win-arm64 -DestinationPath bin/Release/ZIPs/Benchmarker-win-arm64.zip
Compress-Archive -Path bin/Release/Benchmarker-linux64 -DestinationPath bin/Release/ZIPs/Benchmarker-linux64.zip
Compress-Archive -Path bin/Release/Benchmarker-debian64 -DestinationPath bin/Release/ZIPs/Benchmarker-debian64.zip
Compress-Archive -Path bin/Release/Benchmarker-ubuntu64 -DestinationPath bin/Release/ZIPs/Benchmarker-ubuntu64.zip
Compress-Archive -Path bin/Release/Benchmarker-osx64 -DestinationPath bin/Release/ZIPs/Benchmarker-osx64.zip
Remove-Item -Recurse -Path bin/Release/Benchmarker
Remove-Item -Recurse -Path bin/Release/Benchmarker-win64
Remove-Item -Recurse -Path bin/Release/Benchmarker-win32
Remove-Item -Recurse -Path bin/Release/Benchmarker-linux-arm32v7
Remove-Item -Recurse -Path bin/Release/Benchmarker-win-arm32v7
Remove-Item -Recurse -Path bin/Release/Benchmarker-win-arm64
Remove-Item -Recurse -Path bin/Release/Benchmarker-linux64
Remove-Item -Recurse -Path bin/Release/Benchmarker-debian64
Remove-Item -Recurse -Path bin/Release/Benchmarker-ubuntu64
Remove-Item -Recurse -Path bin/Release/Benchmarker-osx64