-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
rem 设置.csproj文件的路径,假设它与批处理脚本在同一目录下 | ||
set "csprojPath=RealAirplaneTag.csproj" | ||
|
||
rem 使用findstr命令提取Version标签的内容 | ||
for /f "tokens=2 delims=<>" %%i in ('type "%csprojPath%" ^| findstr /c:"<Version>"') do ( | ||
set "version=%%i" | ||
) | ||
|
||
rem 移除版本号中的前后空格 | ||
set "version=!version: =!" | ||
|
||
rem 打印版本号以确认 | ||
echo Current version: !version! | ||
|
||
rem 使用Git命令打标签并推送 | ||
git tag -a v!version! -m "Release v!version!" | ||
git push origin --tags | ||
|
||
endlocal |