Skip to content

Commit 0907e24

Browse files
lzy98276yuanbenxinQiKeZhiCao
committed
release:v1.1.2.0-beta
Co-Authored-By: 袁本新 <yuanbenxin@outlook.com> Co-Authored-By: QiKeZhiCao <122373065+QiKeZhiCao@users.noreply.github.com>
1 parent 42393ab commit 0907e24

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

update_version.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22
import re
33

44
def get_version_from_env():
5+
# 🌟 星野小贴士:这里获取版本号并确保它是有效的数字格式哦 ~
56
original_version = os.getenv('VERSION', 'v1.0.0.0')
67
stripped_version = re.sub(r'^v', '', original_version)
8+
9+
# 🔍 白露检查:如果版本号包含非数字字符,提取数字部分
10+
numeric_version = re.search(r'^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?', stripped_version)
11+
if numeric_version:
12+
# 组装有效的X.X.X.X格式版本号
13+
parts = numeric_version.groups(default='0')
14+
stripped_version = '.'.join(parts)
15+
else:
16+
# 如果无法提取,使用默认版本
17+
stripped_version = '1.0.0.0'
18+
original_version = 'v1.0.0.0'
19+
720
return original_version, stripped_version
821

922
def update_version_info(version):

0 commit comments

Comments
 (0)