chore: patch bump for release pipeline fixes #125
85
.github/workflows/release.yml
vendored
85
.github/workflows/release.yml
vendored
@@ -375,6 +375,7 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Cascading channels: each stability updates itself and all lower levels
|
||||||
export PY_STABILITY="$STABILITY" PY_VERSION="$VERSION" PY_SHA256="$SHA256" \
|
export PY_STABILITY="$STABILITY" PY_VERSION="$VERSION" PY_SHA256="$SHA256" \
|
||||||
PY_ZIP_NAME="$ZIP_NAME" PY_TAG="$TAG" PY_DATE="$DATE" \
|
PY_ZIP_NAME="$ZIP_NAME" PY_TAG="$TAG" PY_DATE="$DATE" \
|
||||||
PY_GITEA_ORG="$GITEA_ORG" PY_GITEA_REPO="$GITEA_REPO"
|
PY_GITEA_ORG="$GITEA_ORG" PY_GITEA_REPO="$GITEA_REPO"
|
||||||
@@ -390,73 +391,53 @@ jobs:
|
|||||||
gitea_org = os.environ["PY_GITEA_ORG"]
|
gitea_org = os.environ["PY_GITEA_ORG"]
|
||||||
gitea_repo = os.environ["PY_GITEA_REPO"]
|
gitea_repo = os.environ["PY_GITEA_REPO"]
|
||||||
|
|
||||||
# Map stability to the <tag> value in updates.xml
|
# Cascade map: each level updates itself + all lower levels
|
||||||
tag_map = {
|
cascade = {
|
||||||
"development": "development",
|
"stable": ["development", "alpha", "beta", "rc", "stable"],
|
||||||
"alpha": "alpha",
|
"rc": ["development", "alpha", "beta", "rc"],
|
||||||
"beta": "beta",
|
"beta": ["development", "alpha", "beta"],
|
||||||
"rc": "rc",
|
"alpha": ["development", "alpha"],
|
||||||
"stable": "stable",
|
"development": ["development"],
|
||||||
}
|
}
|
||||||
xml_tag = tag_map.get(stability, "development")
|
targets = cascade.get(stability, [stability])
|
||||||
|
|
||||||
with open("updates.xml", "r") as f:
|
with open("updates.xml", "r") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
||||||
# Build regex to find the specific <update> block for this stability tag
|
|
||||||
# Use negative lookahead to avoid matching across multiple <update> blocks
|
|
||||||
block_pattern = r"(<update>(?:(?!</update>).)*?<tag>" + re.escape(xml_tag) + r"</tag>.*?</update>)"
|
|
||||||
match = re.search(block_pattern, content, re.DOTALL)
|
|
||||||
|
|
||||||
if not match:
|
|
||||||
print(f"No <update> block found for <tag>{xml_tag}</tag>")
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
block = match.group(1)
|
|
||||||
original_block = block
|
|
||||||
|
|
||||||
# Update version
|
|
||||||
block = re.sub(r"<version>[^<]*</version>", f"<version>{version}</version>", block)
|
|
||||||
|
|
||||||
# Update creation date
|
|
||||||
block = re.sub(r"<creationDate>[^<]*</creationDate>", f"<creationDate>{date}</creationDate>", block)
|
|
||||||
|
|
||||||
# Update or add SHA-256
|
|
||||||
if "<sha256>" in block:
|
|
||||||
block = re.sub(r"<sha256>[^<]*</sha256>", f"<sha256>{sha256}</sha256>", block)
|
|
||||||
else:
|
|
||||||
block = block.replace("</downloads>", f"</downloads>\n <sha256>{sha256}</sha256>")
|
|
||||||
|
|
||||||
# Update Gitea download URL
|
|
||||||
gitea_url = f"https://git.mokoconsulting.tech/{gitea_org}/{gitea_repo}/releases/download/{tag}/{zip_name}"
|
gitea_url = f"https://git.mokoconsulting.tech/{gitea_org}/{gitea_repo}/releases/download/{tag}/{zip_name}"
|
||||||
block = re.sub(
|
|
||||||
r"(<downloadurl[^>]*>)https://git\.mokoconsulting\.tech/[^<]*(</downloadurl>)",
|
|
||||||
rf"\g<1>{gitea_url}\g<2>",
|
|
||||||
block
|
|
||||||
)
|
|
||||||
|
|
||||||
# Update GitHub download URL only for RC and stable (others are Gitea-only)
|
for xml_tag in targets:
|
||||||
if stability in ("rc", "stable"):
|
block_pattern = r"(<update>(?:(?!</update>).)*?<tag>" + re.escape(xml_tag) + r"</tag>.*?</update>)"
|
||||||
gh_url = f"https://github.com/mokoconsulting-tech/{gitea_repo}/releases/download/{tag}/{zip_name}"
|
match = re.search(block_pattern, content, re.DOTALL)
|
||||||
|
|
||||||
|
if not match:
|
||||||
|
print(f"No block for <tag>{xml_tag}</tag> — skipping")
|
||||||
|
continue
|
||||||
|
|
||||||
|
block = match.group(1)
|
||||||
|
original = block
|
||||||
|
|
||||||
|
block = re.sub(r"<version>[^<]*</version>", f"<version>{version}</version>", block)
|
||||||
|
block = re.sub(r"<creationDate>[^<]*</creationDate>", f"<creationDate>{date}</creationDate>", block)
|
||||||
|
|
||||||
|
if "<sha256>" in block:
|
||||||
|
block = re.sub(r"<sha256>[^<]*</sha256>", f"<sha256>{sha256}</sha256>", block)
|
||||||
|
else:
|
||||||
|
block = block.replace("</downloads>", f"</downloads>\n <sha256>{sha256}</sha256>")
|
||||||
|
|
||||||
block = re.sub(
|
block = re.sub(
|
||||||
r"(<downloadurl[^>]*>)https://github\.com/[^<]*(</downloadurl>)",
|
r"(<downloadurl[^>]*>)https://git\.mokoconsulting\.tech/[^<]*(</downloadurl>)",
|
||||||
rf"\g<1>{gh_url}\g<2>",
|
rf"\g<1>{gitea_url}\g<2>",
|
||||||
block
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
# Remove any GitHub download URL for dev/alpha/beta
|
|
||||||
block = re.sub(
|
|
||||||
r"\n\s*<downloadurl[^>]*>https://github\.com/[^<]*</downloadurl>",
|
|
||||||
"",
|
|
||||||
block
|
block
|
||||||
)
|
)
|
||||||
|
|
||||||
content = content.replace(original_block, block)
|
content = content.replace(original, block)
|
||||||
|
print(f"Updated {xml_tag} channel")
|
||||||
|
|
||||||
with open("updates.xml", "w") as f:
|
with open("updates.xml", "w") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
print(f"Updated {xml_tag} channel: version={version}, sha={sha256[:16]}..., date={date}")
|
print(f"Cascaded {stability} → {', '.join(targets)}: v={version}, sha={sha256[:16]}...")
|
||||||
PYEOF
|
PYEOF
|
||||||
|
|
||||||
- name: "Commit updates.xml to current branch and main"
|
- name: "Commit updates.xml to current branch and main"
|
||||||
|
|||||||
Reference in New Issue
Block a user