-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
51 lines (38 loc) · 1.1 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
@echo off
setlocal
if exist *.nupkg del *.nupkg
if errorlevel 1 goto error
if exist *.snupkg del *.snupkg
if errorlevel 1 goto error
for /d %%f in (*.*) do (
if exist "%%f\bin" rd /s /q "%%f\bin"
if errorlevel 1 goto error
if exist "%%f\obj" rd /s /q "%%f\obj"
if errorlevel 1 goto error
)
if errorlevel 1 goto error
set SUFFIX=
for /f %%f in ('git rev-parse --abbrev-ref HEAD') do set GITBRANCH=%%f
if not "%GITBRANCH%" == "master" (
set SUFFIX=beta
)
dotnet restore
if errorlevel 1 goto error
dotnet build /p:VERSIONSUFFIX=%SUFFIX%
if errorlevel 1 goto error
dotnet test /p:VERSIONSUFFIX=%SUFFIX%
if errorlevel 1 goto error
for /d %%f in (*.*) do (
if exist "%%f\bin\Debug\*.nupkg" move "%%f\bin\Debug\*.nupkg" .\
if errorlevel 1 goto error
if exist "%%f\bin\Debug\*.snupkg" move "%%f\bin\Debug\*.snupkg" .\
if errorlevel 1 goto error
if exist "%%f\bin\Release\*.nupkg" move "%%f\bin\Release\*.nupkg" .\
if errorlevel 1 goto error
if exist "%%f\bin\Release\*.snupkg" move "%%f\bin\Release\*.snupkg" .\
if errorlevel 1 goto error
)
goto end
:error
exit /B 1
:end