Update version_branch.yml
This commit is contained in:
10
.github/workflows/version_branch.yml
vendored
10
.github/workflows/version_branch.yml
vendored
@@ -123,7 +123,7 @@ jobs:
|
|||||||
HIT_VERSION=0
|
HIT_VERSION=0
|
||||||
for d in "${TARGET_DIRS[@]}"; do
|
for d in "${TARGET_DIRS[@]}"; do
|
||||||
[[ -d "${d}" ]] || continue
|
[[ -d "${d}" ]] || continue
|
||||||
COUNT=$(grep -RIn --exclude-dir=.git "^[[:space:]]*VERSION[[:space:]]*:" "${d}" | wc -l || true)
|
COUNT=$(grep -RIn --exclude-dir=.git -E "VERSION[[:space:]]*:" "${d}" | wc -l || true)
|
||||||
echo "[INFO] VERSION: hits in ${d}: ${COUNT}"
|
echo "[INFO] VERSION: hits in ${d}: ${COUNT}"
|
||||||
HIT_VERSION=$((HIT_VERSION + COUNT))
|
HIT_VERSION=$((HIT_VERSION + COUNT))
|
||||||
done
|
done
|
||||||
@@ -159,8 +159,7 @@ jobs:
|
|||||||
root = Path(".").resolve()
|
root = Path(".").resolve()
|
||||||
targets = [root / "src", root / "docs"]
|
targets = [root / "src", root / "docs"]
|
||||||
|
|
||||||
header_re = re.compile(r"(?m)^(\s*VERSION\s*:\s*)(\S+)(\s*)$")
|
xml_re = re.compile(r"(?is)(<version\s*>)([^<]*?)(</version\s*>)")
|
||||||
xml_re = re.compile(r"(?is)(<version\s*>)([^<]*?)(</version\s*>)")
|
|
||||||
|
|
||||||
skip_ext = {".json", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".pdf", ".zip", ".7z", ".tar", ".gz", ".woff", ".woff2", ".ttf", ".otf", ".mp3", ".mp4"}
|
skip_ext = {".json", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".pdf", ".zip", ".7z", ".tar", ".gz", ".woff", ".woff2", ".ttf", ".otf", ".mp3", ".mp4"}
|
||||||
skip_dirs = {".git", "node_modules", "vendor", ".venv", "dist", "build"}
|
skip_dirs = {".git", "node_modules", "vendor", ".venv", "dist", "build"}
|
||||||
@@ -205,9 +204,8 @@ jobs:
|
|||||||
|
|
||||||
original = text
|
original = text
|
||||||
|
|
||||||
text, n1 = header_re.subn(r"\\1" + new_version + r"\\3", text)
|
text, n1 = header_re.subn(r"\" + new_version, text)
|
||||||
if n1:
|
+= n1
|
||||||
counters["header_replacements"] += n1
|
|
||||||
|
|
||||||
if p.suffix.lower() == ".xml":
|
if p.suffix.lower() == ".xml":
|
||||||
text2, n2 = xml_re.subn(r"\\1" + new_version + r"\\3", text)
|
text2, n2 = xml_re.subn(r"\\1" + new_version + r"\\3", text)
|
||||||
|
|||||||
Reference in New Issue
Block a user