mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-07 16:01:10 +00:00
Add parametrized release script
[ci skip]
This commit is contained in:
parent
2c60d95ee2
commit
e4126d8d6f
7 changed files with 798 additions and 339 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import subprocess
|
||||
|
@ -10,9 +11,9 @@ ROOT = Path(__file__).resolve().parents[1]
|
|||
|
||||
|
||||
def determine_project() -> str:
|
||||
text = (ROOT / "CMakeLists.txt").read_text()
|
||||
match = next(re.finditer(r"project\((?P<project>[a-zA-Z0-9_]+)\s+", text, flags=re.M))
|
||||
project_with_version = match["project"]
|
||||
text = (ROOT / "build-scripts/release-info.json").read_text()
|
||||
release_info = json.loads(text)
|
||||
project_with_version = release_info["name"]
|
||||
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
|
||||
return project
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue