Skip to content

Commit

Permalink
Create tag.cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Maicarons committed Jun 13, 2024
1 parent f3c4504 commit 8c61567
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tag.cmd
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

0 comments on commit 8c61567

Please sign in to comment.