2
2
3
3
setlocal
4
4
5
+ del *.nupkg
6
+ if errorlevel 1 goto error
7
+
5
8
if " %SIGNINGKEYS% " == " " goto setup
6
9
7
- set year = %date:~6 ,4 %
8
- set month = %date:~3 ,2 %
9
- set day = %date:~0 ,2 %
10
- set tm = %time:~0 ,2 %%time:~3 ,2 %
10
+ set /A year = %date:~ 6,4%
11
+ set /A month = %date:~ 3,2%
12
+ set /A day = %date:~ 0,2%
13
+ set /A tm = %time:~ 0,2%% time:~ 3,2%
11
14
12
15
copy " %SIGNINGKEYS% \Lasse V. Karlsen Private.snk" " DiffLib\Lasse V. Karlsen.snk"
13
16
if errorlevel 1 goto error
@@ -18,13 +21,26 @@ if errorlevel 1 goto error
18
21
nuget restore
19
22
if errorlevel 1 goto error
20
23
21
- msbuild DiffLib\DiffLib.csproj /target:Clean,Rebuild /p:Configuration=Release /p:Version=%year% .%month% .%day% .%tm%
24
+ set VERSION = %year% .%month% .%day% .%tm%
25
+ msbuild DiffLib\DiffLib.csproj /target:Clean,Rebuild /p:Configuration=Release /p:Version=%VERSION%
22
26
if errorlevel 1 goto error
23
27
24
28
copy DiffLib\bin\Release\DiffLib*.nupkg .\
25
29
if errorlevel 1 goto error
26
30
27
31
git checkout " DiffLib\Lasse V. Karlsen.snk"
32
+
33
+ echo=
34
+ echo================================================
35
+ set /P PUSHYESNO = Push package to nuget? [y/N]
36
+ if " %PUSHYESNO% " == " Y" GOTO PUSH
37
+ exit /B 0
38
+
39
+ :PUSH
40
+ nuget push DiffLib.%VERSION% .nupkg -Source https://www.nuget.org/api/v2/package
41
+ if errorlevel 1 goto error
42
+ git tag version/%VERSION%
43
+ if errorlevel 1 goto error
28
44
exit /B 0
29
45
30
46
:error
@@ -36,3 +52,4 @@ goto exitwitherror
36
52
37
53
:exitwitherror
38
54
git checkout " DiffLib\Lasse V. Karlsen.snk"
55
+ exit /B 1
0 commit comments