aboutsummaryrefslogtreecommitdiff
path: root/build/PublishRelease.bat
blob: c6cb6f95b69ac0eb614acb8449a00ab602dbff07 (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
REM @ECHO OFF
@PUSHD %~dp0
@IF "%1" == "version" @GOTO VERSION
@IF "%1" == "build" @GOTO BUILD
@IF "%1" == "fpush" @GOTO FILEPUSH
@IF "%1" == "nupush" @GOTO NUGETPUSH
@IF "%1" == "push" @GOTO PUSH
@GOTO HELP

:VERSION
IF NOT EXIST "..\build_temp\" MD "..\build_temp\"
hg log -l 1 --template "Revision: {rev}" > ..\build_temp\revision.txt
CMD.exe /Q /C "CD .. && lib\StampVersion.exe /major:2 /minor:4 /build:1 /revision:build_temp\revision.txt"
@TYPE ..\src\ProtocolBuffers\Properties\AssemblyInfo.cs | FIND "AssemblyFileVersion"
@ECHO.
@ECHO NEXT: Use the above version number to run "%0 build {Version}"
@ECHO.
@GOTO EXIT

:BUILD
@IF "%2" == "" @GOTO HELP
IF EXIST "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sn.exe" SET WIN7SDK_DIR=C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\

IF NOT EXIST "..\release-key" hg clone https://bitbucket.org/rknapp/protobuf-csharp-port-keyfile ..\release-key

MD "%2"
CMD.exe /Q /C "BuildAll.bat /verbosity:minimal "/p:AssemblyOriginatorKeyFile=%~dp0..\release-key\Google.ProtocolBuffers.snk"

COPY /y ..\build_output\release-binaries.zip %2\protobuf-csharp-port-%2-release-binaries.zip
COPY /y ..\build_output\full-binaries.zip %2\protobuf-csharp-port-%2-full-binaries.zip

..\lib\NuGet.exe pack Google.ProtocolBuffers.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2
..\lib\NuGet.exe pack Google.ProtocolBuffersLite.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2

hg archive %2\protobuf-csharp-port-%2-source.zip

"%WIN7SDK_DIR%sn.exe" -T ..\build_output\v2.0\Release\Google.ProtocolBuffers.dll
@ECHO.
@ECHO ***********************************************************
@ECHO IMPORTANT: Verify the above key output is: 55f7125234beb589
@ECHO ***********************************************************
@ECHO.
@ECHO NEXT: Verify the output in %~dp0\%2 and then run "%0 push %2"
@ECHO.
@GOTO EXIT

:PUSH
@IF "%2" == "" @GOTO HELP

hg commit -m "version %2"
hg tag %2
hg push
@ECHO.
@ECHO NEXT: Verify the repository state and run "%0 fpush %2 {google-code-user} {google-code-password}"
@ECHO.
@GOTO EXIT

:FILEPUSH
@IF "%2" == "" @GOTO HELP
@IF "%3" == "" @GOTO HELP
@IF "%4" == "" @GOTO HELP
SET GOOGLEUPLOAD=python.exe googlecode_upload.py --project protobuf-csharp-port --user "%3" --password "%4"

%GOOGLEUPLOAD% --labels Type-Source,Featured --summary "Version %2 source" %2\protobuf-csharp-port-%2-source.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (all configurations)" %2\protobuf-csharp-port-%2-full-binaries.zip
%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (release only)" %2\protobuf-csharp-port-%2-release-binaries.zip

@SET GOOGLEUPLOAD=
@ECHO.
@ECHO NEXT: Verify the uploads and run "%0 nupush %2"
@ECHO.
@GOTO EXIT

:NUGETPUSH

..\lib\NuGet.exe push "%2\Google.ProtocolBuffers.%2.nupkg"
..\lib\NuGet.exe push "%2\Google.ProtocolBuffersLite.%2.nupkg"
..\lib\NuGet.exe push "%2\Google.ProtocolBuffers.%2.symbols.nupkg"
..\lib\NuGet.exe push "%2\Google.ProtocolBuffersLite.%2.symbols.nupkg"

@ECHO.
@ECHO NEXT: Verify the nuget packages at http://nuget.org
@ECHO.
@GOTO EXIT

:HELP
@ECHO.
@ECHO Available commands, run in the following order:
@ECHO 1. %0 version
@ECHO 2. %0 build {version from step 1}
@ECHO 3. %0 push {version from step 1}
@ECHO 4. %0 fpush {version from step 1} {google-code-user} {google-code-password}
@ECHO 5. %0 nupush {version from step 1}
@ECHO.
@GOTO EXIT

:EXIT
@POPD