forked from riok/SpiderEye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-NuGet.bat
60 lines (49 loc) · 961 Bytes
/
publish-NuGet.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
@ECHO OFF
SETLOCAL
IF "%1"=="" (
ECHO No NuGet API key provided
EXIT /B 1
)
SET apiKey=%1
SET folder="Publish"
ECHO Prepare publish...
IF EXIST %folder% (
rmdir %folder% /s /q
IF %ERRORLEVEL% NEQ 0 (
ECHO Removing folder %folder% failed
EXIT /B 1
)
)
CALL :PackProject Core
IF %ERRORLEVEL% NEQ 0 (
ECHO Build failed!
EXIT /B 1
)
CALL :PackProject Windows
IF %ERRORLEVEL% NEQ 0 (
ECHO Build failed!
EXIT /B 1
)
CALL :PackProject Linux
IF %ERRORLEVEL% NEQ 0 (
ECHO Build failed!
EXIT /B 1
)
CALL :PackProject Mac
IF %ERRORLEVEL% NEQ 0 (
ECHO Build failed!
EXIT /B 1
)
ECHO Publishing package...
dotnet nuget push %folder%\*.nupkg -k %apiKey% -s https://api.nuget.org/v3/index.json > NUL
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)
ECHO Cleaning up...
rmdir %folder% /s /q
EXIT /B 0
:PackProject
ECHO Building for %1...
dotnet pack Source\SpiderEye.%1 -c Release -o %folder% > NUL
EXIT /B