From 85e2b804aaa3acb03b06bdccd8bc1b38b0c8ff65 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Fri, 17 Apr 2026 05:15:35 -0500 Subject: [PATCH] Fix updates.xml + release workflow Python heredoc bug - Restore updates.xml from broken ${VAR} placeholders to actual values - Dev/alpha/beta: Gitea-only download URLs (no GitHub) - RC/stable: both Gitea + GitHub download URLs - Fix Python heredoc: use os.environ instead of shell var expansion - Workflow now removes GitHub URLs for non-RC/stable channels Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 43 ++++++++++++++++++++++------------- updates.xml | 11 ++++----- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec83807..bd051f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -286,17 +286,20 @@ jobs: exit 0 fi + export PY_STABILITY="$STABILITY" PY_VERSION="$VERSION" PY_SHA256="$SHA256" \ + PY_ZIP_NAME="$ZIP_NAME" PY_TAG="$TAG" PY_DATE="$DATE" \ + PY_GITEA_ORG="$GITEA_ORG" PY_GITEA_REPO="$GITEA_REPO" python3 << 'PYEOF' - import re + import re, os - stability = "${STABILITY}" - version = "${VERSION}" - sha256 = "${SHA256}" - zip_name = "${ZIP_NAME}" - tag = "${TAG}" - date = "${DATE}" - gitea_org = "${GITEA_ORG}" - gitea_repo = "${GITEA_REPO}" + stability = os.environ["PY_STABILITY"] + version = os.environ["PY_VERSION"] + sha256 = os.environ["PY_SHA256"] + zip_name = os.environ["PY_ZIP_NAME"] + tag = os.environ["PY_TAG"] + date = os.environ["PY_DATE"] + gitea_org = os.environ["PY_GITEA_ORG"] + gitea_repo = os.environ["PY_GITEA_REPO"] # Map stability to the value in updates.xml tag_map = { @@ -340,13 +343,21 @@ jobs: block ) - # Update GitHub download URL (if present) - gh_url = f"https://github.com/mokoconsulting-tech/{gitea_repo}/releases/download/{tag}/{zip_name}" - block = re.sub( - r"(]*>)https://github\.com/[^<]*()", - rf"\g<1>{gh_url}\g<2>", - block - ) + # Update GitHub download URL only for RC and stable (others are Gitea-only) + if stability in ("rc", "stable"): + gh_url = f"https://github.com/mokoconsulting-tech/{gitea_repo}/releases/download/{tag}/{zip_name}" + block = re.sub( + r"(]*>)https://github\.com/[^<]*()", + rf"\g<1>{gh_url}\g<2>", + block + ) + else: + # Remove any GitHub download URL for dev/alpha/beta + block = re.sub( + r"\n\s*]*>https://github\.com/[^<]*", + "", + block + ) content = content.replace(original_block, block) diff --git a/updates.xml b/updates.xml index 4a09045..1439dec 100644 --- a/updates.xml +++ b/updates.xml @@ -13,14 +13,13 @@ mokocassiopeia template site - ${VERSION} - ${DATE} + 03.09.16 + 2026-04-17 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/development - https://git.mokoconsulting.tech/${GITEA_ORG}/${GITEA_REPO}/releases/download/${TAG}/${ZIP_NAME} - https://github.com/mokoconsulting-tech/${GITEA_REPO}/releases/download/${TAG}/${ZIP_NAME} + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/development/mokocassiopeia-03.09.16-dev.zip - sha256:${SHA256} + sha256:2986f08b59617a18d489e0d9e6e49d329ceb8297ae4755b6697f3326c2a41fc4 development Moko Consulting https://mokoconsulting.tech @@ -40,7 +39,6 @@ https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/alpha https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/alpha/mokocassiopeia-03.09.16-alpha.zip - https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/alpha/mokocassiopeia-03.09.16-alpha.zip c2660acdf7389244462485f7ab4c286e9f851366a148acc16739a184576f7932 alpha @@ -62,7 +60,6 @@ https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/beta https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/beta/mokocassiopeia-03.09.16-beta.zip - https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/beta/mokocassiopeia-03.09.16-beta.zip 4cbe4fc379182ef17580396e7d12ce4ce95a90017ef364b922bdc2d04b0b3d97 beta