forked from atauenis/webone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
62 lines (57 loc) · 2.12 KB
/
build.bat
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
@echo WebOne build script 28.11.2023
@echo.
@echo Clean up directories:
@rmdir bin\Release /S
@rmdir bin\ReleaseSC /S
@echo.
@echo Checking for packaging toolkit updates...
@dotnet tool update --global dotnet-zip
@IF ERRORLEVEL 1 GOTO NoToolkit
@IF ERRORLEVEL 9009 GOTO NoNetSDK
@dotnet tool update --global dotnet-deb
@IF ERRORLEVEL 1 GOTO NoToolkit
@dotnet tool update --global dotnet-rpm
@IF ERRORLEVEL 1 GOTO NoToolkit
@dotnet tool update --global dotnet-tarball
@IF ERRORLEVEL 1 GOTO NoToolkit
@echo.
:Build
@echo Building WebOne for Debian/Ubuntu, RedHat/CentOS, macOS and Windows...
dotnet restore
dotnet publish -c Release -r linux-x64 -t:CreateDeb,CreateRpm,Clean
dotnet publish -c ReleaseSC -r linux-arm -t:CreateDeb,CreateRpm,Clean
dotnet publish -c ReleaseSC -r linux-arm64 -t:CreateDeb,CreateRpm,Clean
dotnet publish -c Release -r osx-x64 -t:CreateZip,Clean
dotnet publish -c Release -r osx-arm64 -t:CreateZip,Clean
dotnet publish -c Release -r win-x86 -t:CreateZip,Clean
dotnet publish -c ReleaseSC -r win-x86 -t:CreateZip,Clean
dotnet publish -c Release -r win-arm -t:CreateZip,Clean
dotnet publish -c Release -r win-x64 -t:CreateZip,Clean
@rem Win32 build must be last because else VS debugging will be broken.
@echo.
@echo All platforms and kinds of packages are processed.
@echo.
@GOTO :EOF
:NoToolkit
@echo BUILD PROBLEM:
@echo Your environment does not have Packaging utilities for .NET installed.
@echo Press any key to install them and try again, or Ctrl+C to exit this script now.
@echo.
@pause
dotnet tool install --global dotnet-zip
dotnet tool install --global dotnet-tarball
dotnet tool install --global dotnet-rpm
dotnet tool install --global dotnet-deb
dotnet zip install
dotnet tarball install
dotnet rpm install
dotnet deb install
@IF ERRORLEVEL 0 GOTO Build
@echo Seems, an error occured. How about to read this:
@echo https://github.com/quamotion/dotnet-packaging ?
@GOTO :EOF
:NoNetSDK
@echo ERROR:
@echo You need to have Microsoft .NET SDK 6 or Microsoft Visual Studio 2022+.
@echo Download it here: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
@echo or here: https://visualstudio.microsoft.com/ru/vs/community/