-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpre-release.bat
55 lines (39 loc) · 904 Bytes
/
pre-release.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
@echo off
IF %1.==. GOTO KeyError
set versionSuffix=%1
IF %2.==. GOTO KeyError
set apikey=%2
GOTO Begin
:KeyError
ECHO.
ECHO ERROR: No apikey was specified
ECHO.
GOTO End
:Begin
ECHO.
ECHO Cleaning up...
ECHO.
IF EXIST "%~dp0\PreReleaseBuilds" (
rmdir "%~dp0\PreReleaseBuilds" /s /q
)
mkdir "%~dp0\PreReleaseBuilds"
rem Cleaning Builds...
dotnet clean -c Debug CDP4-SDK.sln /p:Platform="Any CPU"
ECHO.
ECHO Packing nugets...
ECHO.
rem Packing New Versions...
dotnet pack -c Debug --version-suffix "%versionSuffix%" -o PreReleaseBuilds CDP4-SDK.sln /p:Platform="Any CPU"
ECHO.
ECHO Pushing to github ...
ECHO.
for %%f in (%~dp0PreReleaseBuilds\*.nupkg) do (
(Echo "%%f" | FIND /I "symbols" 1>NUL) || (
echo Pushing %%f
dotnet nuget push "%%f" --source https://nuget.pkg.github.com/STARIONGROUP/index.json -k %apikey%
)
)
:End
ECHO.
ECHO Release Completed
ECHO.