| 1 |
@REM Copyright (c) Microsoft. All rights reserved. |
| 2 |
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| 3 |
|
| 4 |
@setlocal EnableExtensions EnableDelayedExpansion |
| 5 |
@echo off |
| 6 |
|
| 7 |
set current-path=%~dp0 |
| 8 |
|
| 9 |
rem // remove trailing slash |
| 10 |
set current-path=%current-path:~0,-1% |
| 11 |
|
| 12 |
set build-root=%current-path%\.. |
| 13 |
rem // resolve to fully qualified path |
| 14 |
for %%i in ("%build-root%") do set build-root=%%~fi |
| 15 |
|
| 16 |
if not exist %build-root%/version.txt ( |
| 17 |
echo Version.txt does not exist |
| 18 |
exit /b 1 |
| 19 |
) |
| 20 |
|
| 21 |
set /p Version=<%build-root%/version.txt |
| 22 |
|
| 23 |
git tag -a "v%Version%" -m "Release of v%Version%" |
| 24 |
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! |
| 25 |
|
| 26 |
git push --tags |
| 27 |
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! |