PagerMaid-Pyro/.github/get_version.py
xtaodada a57f75a7f8
All checks were successful
Docker Dev Build / docker build and publish (push) Successful in 7m27s
Docker Build / docker build and publish (push) Successful in 11m37s
👷 fix: ci get_version
2024-09-28 22:47:08 +08:00

13 lines
295 B
Python

import re
def get_version():
with open("pagermaid/version.py", "r", encoding="utf-8") as f:
if version_match := re.search(r'pgm_version = "(.*?)"', f.read()):
return version_match[1]
raise FileNotFoundError
if __name__ == "__main__":
print(get_version())