-
-
Notifications
You must be signed in to change notification settings - Fork 571
/
Deploy_to_all.bat
192 lines (156 loc) · 4.85 KB
/
Deploy_to_all.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
@echo off
setlocal
call SetEscChar.cmd
if exist "%~dp0Deploy\user_env.cmd" (
call "%~dp0Deploy\user_env.cmd"
) else (
call "%~dp0Deploy\user_env.default.cmd"
)
call "%GIT%" --version 1> nul 2> nul
if errorlevel 1 (
call cecho "git not found, please configure user_env.cmd"
exit /b 1
)
cd /d "%~dp0"
"%GIT%" log -5 --decorate=short --oneline
"%GIT%" status
rem Returns env.var 'CurVerBuild' from version.h
call :getcurbuild
echo .
echo .
set /P do_REL=%ESC%[1;31;40mCreate "%CurVerBuild% release files" commit [Y/n/q]: %ESC%[m
if /I "%do_REL%" == "q" exit /B 1
set /P do_TAG=%ESC%[1;31;40mCreate "v%CurVerBuild:~0,2%.%CurVerBuild:~2,2%.%CurVerBuild:~4%" tag [Y/n/q]: %ESC%[m
if /I "%do_TAG%" == "q" exit /B 1
set /P do_MST=%ESC%[1;31;40mMerge Daily branch into Master [Y/n/q]: %ESC%[m
if /I "%do_MST%" == "q" exit /B 1
rem set /P do_MPV=%ESC%[1;31;40mMerge Daily branch into Preview [y/N/q]: %ESC%[m
rem if /I "%do_MPV%" == "q" exit /B 1
set /P do_GHB=%ESC%[1;31;40mDeploy Branches to github^&sourgeforge [Y/n/q]: %ESC%[m
if /I "%do_GHB%" == "q" exit /B 1
set /P do_GRL=%ESC%[1;31;40mDeploy Release to github [Y/n/q]: %ESC%[m
if /I "%do_GRL%" == "q" exit /B 1
set /P do_CKL=%ESC%[1;31;40mDeploy Release to chocolatey [Y/n/q]: %ESC%[m
if /I "%do_CKL%" == "q" exit /B 1
set /P do_NGT=%ESC%[1;31;40mDeploy Release to nuget [Y/n/q]: %ESC%[m
if /I "%do_NGT%" == "q" exit /B 1
set /P do_FSH=%ESC%[1;31;40mDeploy Release to fosshub [Y/n/q]: %ESC%[m
if /I "%do_FSH%" == "q" exit /B 1
set /P do_VER=%ESC%[1;31;40mBinaries [(A)lpha/(p)review/(pa)preview+alpha/(s)table/n/q]: %ESC%[m
if /I "%do_VER%" == "q" exit /B 1
echo .%ESC%[1;32;40m
pause
echo %ESC%[m.
if /I "%do_CKL%" == "N" goto skip_CHOCO1
pushd "%~dp0nuget"
call cecho /yellow "Creating Chocolatey package"
call "%~dp0nuget\build.cmd"
if errorlevel 1 goto err
popd
:skip_CHOCO1
if /I "%do_NGT%" == "N" goto skip_NUGET1
pushd "%~dp0nuget"
call cecho /yellow "Creating NuGet package"
call "%~dp0nuget\build.nuget-org.cmd"
if errorlevel 1 goto err
popd
:skip_NUGET1
if /I "%do_FSH%" == "N" goto skip_FOSS
pushd "%CONEMU_DEPLOY%"
call "%CONEMU_DEPLOY%foss.cmd" %CurVerBuild%
if errorlevel 1 goto err
popd
:skip_FOSS
if /I "%do_REL%" == "N" goto skip_REL
"%GIT%" commit -am "%CurVerBuild% release files"
if errorlevel 1 goto err
:skip_REL
if /I "%do_TAG%" == "N" goto skip_TAG
"%GIT%" tag v%CurVerBuild:~0,2%.%CurVerBuild:~2,2%.%CurVerBuild:~4%
if errorlevel 1 goto err
rem Move "v-preview" or "v-alpha" tag to the current location
if /I "%do_VER%" == "N" goto skip_TAG
"%GIT%" tag -f v-release
if /I "%do_VER%" == "S" (
"%GIT%" tag -f v-stable
) else if /I "%do_VER%" == "P" (
"%GIT%" tag -f v-preview
) else if /I "%do_VER%" == "PA" (
"%GIT%" tag -f v-preview
) else (
"%GIT%" tag -f v-alpha
)
rem Stable build is not available yet, so there is no v-stable tag
:skip_TAG
rem if /I NOT "%do_MPV%" == "Y" goto skip_MPV
rem "%GIT%" checkout preview
rem if errorlevel 1 goto err
rem "%GIT%" merge daily
rem if errorlevel 1 goto err
:skip_MPV
if /I "%do_MST%" == "N" goto skip_MST
"%GIT%" checkout master
if errorlevel 1 goto err
"%GIT%" merge daily
if errorlevel 1 goto err
"%GIT%" checkout daily
:skip_MST
"%GIT%" log -5 --decorate=short --oneline
rem \Utils\Lans\GIT\bin\git.exe branch
rem call cecho "Press enter to deploy `%CurVerBuild% Alpha` to github/sourgeforge"
rem pause
if /I "%do_GHB%" == "N" goto skip_GHB
"%GIT%" push origin master daily
if errorlevel 1 goto err
"%GIT%" push -f origin --tags
if errorlevel 1 goto err
if /I "%do_GRL%" == "N" (
echo Release creating skipped!
) else (
echo Creating release: v%CurVerBuild:~0,2%.%CurVerBuild:~2,2%.%CurVerBuild:~4% %CurVerBuild%
call "%UPLOADERS%ConEmuGithubRelease.cmd" v%CurVerBuild:~0,2%.%CurVerBuild:~2,2%.%CurVerBuild:~4% %CurVerBuild%
if errorlevel 1 goto err
)
"%GIT%" push forge
:skip_GHB
if /I "%do_CKL%" == "N" goto skip_CHOCO2
pushd "%~dp0nuget"
call cecho /yellow "Uploading Chocolatey package"
call "%~dp0nuget\upload.cmd"
if errorlevel 1 goto err
popd
:skip_CHOCO2
if /I "%do_NGT%" == "N" goto skip_NUGET2
pushd "%~dp0nuget"
call cecho /yellow "Uploading NuGet package"
call "%~dp0nuget\upload.nuget-org.cmd"
if errorlevel 1 goto err
popd
:skip_NUGET2
if /I "%do_VER%" == "N" goto skip_AUTO
pushd "%CONEMU_DEPLOY%"
if /I "%do_VER%" == "S" (
call "%CONEMU_DEPLOY%upld.cmd" %CurVerBuild% "Stable"
) else if /I "%do_VER%" == "P" (
call "%CONEMU_DEPLOY%upld.cmd" %CurVerBuild% "Preview"
) else if /I "%do_VER%" == "PA" (
call "%CONEMU_DEPLOY%upld.cmd" %CurVerBuild% "Preview+Alpha"
) else (
call "%CONEMU_DEPLOY%upld.cmd" %CurVerBuild% "Alpha"
)
if errorlevel 1 goto err
popd
:skip_AUTO
rem call cecho "Press enter to deploy `%CurVerBuild% Alpha` to googlecode/ConEmu-alpha"
rem pause
rem if "%~1"=="" pause
goto :EOF
:getcurbuild
call "%~dp0Deploy\GetCurVer.cmd"
if "%CurVerBuild%" == "" (
call cecho "Can't find valid version in src\ConEmu\version.h"
exit /B 100
)
goto :EOF
:err
pause