mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-07-28 15:00:56 +00:00
🚸 添加发布工作流
This commit is contained in:
23
liteyuki/version.py
Normal file
23
liteyuki/version.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
||||
|
||||
@Time : 2024/8/18 上午3:49
|
||||
@Author : snowykami
|
||||
@Email : snowykami@outlook.com
|
||||
@File : version.py.py
|
||||
@Software: PyCharm
|
||||
"""
|
||||
from git import Repo
|
||||
from pdm.backend.hooks.version import SCMVersion
|
||||
|
||||
try:
|
||||
__commit__ = Repo(".").head.commit.hexsha
|
||||
except:
|
||||
__commit__ = "unknown"
|
||||
|
||||
__version__ = "6.3.5"
|
||||
|
||||
|
||||
def format_version(version: SCMVersion) -> str:
|
||||
return f"{__version__}+{__commit__[:7]}"
|
Reference in New Issue
Block a user