From 6ff481198aa23b5ef763ff4a0ccd4e7e7097d356 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:55:18 -0500 Subject: [PATCH] ci: sync workflows [skip ci] Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/auto-dev-issue.yml | 26 ++++------- .github/workflows/auto-release.yml | 70 +++++++++++++++++++--------- .github/workflows/update-server.yml | 13 +++++- 3 files changed, 68 insertions(+), 41 deletions(-) diff --git a/.github/workflows/auto-dev-issue.yml b/.github/workflows/auto-dev-issue.yml index 38730ab..38c6a53 100644 --- a/.github/workflows/auto-dev-issue.yml +++ b/.github/workflows/auto-dev-issue.yml @@ -156,30 +156,22 @@ jobs: done fi - # ── RC: Create or update draft release ──────────────────────────── + # ── RC: Create or update release-candidate release ────────────── if [[ "$BRANCH" == rc/* ]]; then - MAJOR=$(echo "$VERSION" | awk -F. '{print $1}') - RELEASE_TAG="v${MAJOR}" - DRAFT_EXISTS=$(gh release view "$RELEASE_TAG" --json isDraft -q .isDraft 2>/dev/null || true) + RELEASE_TAG="release-candidate" + EXISTING=$(gh release view "$RELEASE_TAG" --json tagName -q .tagName 2>/dev/null || true) - if [ -z "$DRAFT_EXISTS" ]; then - # No release exists — create draft + if [ -z "$EXISTING" ]; then gh release create "$RELEASE_TAG" \ - --title "v${MAJOR} (RC: ${VERSION})" \ + --title "release-candidate (${VERSION})" \ --notes "## Release Candidate ${VERSION}\n\nRC branch: \`${BRANCH}\`\nTracking issue: ${PARENT_URL}" \ - --draft \ + --prerelease \ --target main 2>/dev/null || true - echo "Draft release created: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY - elif [ "$DRAFT_EXISTS" = "true" ]; then - # Draft exists — update title - gh release edit "$RELEASE_TAG" \ - --title "v${MAJOR} (RC: ${VERSION})" --draft 2>/dev/null || true - echo "Draft release updated: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY + echo "RC release created: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY else - # Release exists and is published — set back to draft for RC gh release edit "$RELEASE_TAG" \ - --title "v${MAJOR} (RC: ${VERSION})" --draft 2>/dev/null || true - echo "Release ${RELEASE_TAG} set to draft for RC" >> $GITHUB_STEP_SUMMARY + --title "release-candidate (${VERSION})" --prerelease 2>/dev/null || true + echo "RC release updated: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY fi fi diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index f064ceb..3e1caf3 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -316,34 +316,60 @@ jobs: DOWNLOAD_URL="https://github.com/${REPO}/releases/download/v${VERSION}/${EXT_ELEMENT}-${VERSION}.zip" INFO_URL="https://github.com/${REPO}/releases/tag/v${VERSION}" - # -- Write updates.xml (stable release) -------------------------- + # -- Build stable entry ────────────────────────────────────── + STABLE_ENTRY=$(cat < + ${EXT_NAME} + ${EXT_NAME} update + ${EXT_ELEMENT} + ${EXT_TYPE} + ${VERSION} + $([ -n "$CLIENT_TAG" ] && echo " ${CLIENT_TAG}") + $([ -n "$FOLDER_TAG" ] && echo " ${FOLDER_TAG}") + + stable + + ${INFO_URL} + + ${DOWNLOAD_URL} + + ${TARGET_PLATFORM} + $([ -n "$PHP_TAG" ] && echo " ${PHP_TAG}") + Moko Consulting + https://mokoconsulting.tech + +XMLEOF +) + + # -- Write updates.xml preserving dev/rc entries ────────────── + # Extract existing dev and rc entries if present + RC_ENTRY="" + DEV_ENTRY="" + if [ -f "updates.xml" ]; then + RC_ENTRY=$(python3 -c " +import re +with open('updates.xml') as f: c = f.read() +m = re.search(r'( .*?rc.*?)', c, re.DOTALL) +if m: print(m.group(1)) +" 2>/dev/null || true) + DEV_ENTRY=$(python3 -c " +import re +with open('updates.xml') as f: c = f.read() +m = re.search(r'( .*?development.*?)', c, re.DOTALL) +if m: print(m.group(1)) +" 2>/dev/null || true) + fi + { printf '%s\n' '' printf '%s\n' '' - printf '%s\n' ' ' - printf '%s\n' " ${EXT_NAME}" - printf '%s\n' " ${EXT_NAME} update" - printf '%s\n' " ${EXT_ELEMENT}" - printf '%s\n' " ${EXT_TYPE}" - printf '%s\n' " ${VERSION}" - [ -n "$CLIENT_TAG" ] && printf '%s\n' " ${CLIENT_TAG}" - [ -n "$FOLDER_TAG" ] && printf '%s\n' " ${FOLDER_TAG}" - printf '%s\n' ' ' - printf '%s\n' ' stable' - printf '%s\n' ' ' - printf '%s\n' " ${INFO_URL}" - printf '%s\n' ' ' - printf '%s\n' " ${DOWNLOAD_URL}" - printf '%s\n' ' ' - printf '%s\n' " ${TARGET_PLATFORM}" - [ -n "$PHP_TAG" ] && printf '%s\n' " ${PHP_TAG}" - printf '%s\n' ' Moko Consulting' - printf '%s\n' ' https://mokoconsulting.tech' - printf '%s\n' ' ' + echo "$STABLE_ENTRY" + [ -n "$RC_ENTRY" ] && echo "$RC_ENTRY" + [ -n "$DEV_ENTRY" ] && echo "$DEV_ENTRY" printf '%s\n' '' } > updates.xml - echo "updates.xml: ${VERSION} (stable) — ${EXT_TYPE}/${EXT_ELEMENT}" >> $GITHUB_STEP_SUMMARY + echo "updates.xml: ${VERSION} (stable + rc/dev preserved)" >> $GITHUB_STEP_SUMMARY # -- Commit all changes --------------------------------------------------- - name: Commit release changes diff --git a/.github/workflows/update-server.yml b/.github/workflows/update-server.yml index fad30ff..28a6dd7 100644 --- a/.github/workflows/update-server.yml +++ b/.github/workflows/update-server.yml @@ -120,7 +120,16 @@ jobs: [ "$STABILITY" = "development" ] && DISPLAY_VERSION="${VERSION}-dev" MAJOR=$(echo "$VERSION" | awk -F. '{print $1}') - RELEASE_TAG="v${MAJOR}" + + # Each stability level has its own release tag + if [ "$STABILITY" = "rc" ]; then + RELEASE_TAG="release-candidate" + elif [ "$STABILITY" = "development" ]; then + RELEASE_TAG="development" + else + RELEASE_TAG="v${MAJOR}" + fi + PACKAGE_NAME="${EXT_ELEMENT}-${DISPLAY_VERSION}.zip" DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${RELEASE_TAG}/${PACKAGE_NAME}" INFO_URL="https://github.com/${REPO}" @@ -137,7 +146,7 @@ jobs: # Ensure draft release exists for this major gh release view "$RELEASE_TAG" --json tagName > /dev/null 2>&1 || \ - gh release create "$RELEASE_TAG" --title "v${MAJOR}" --notes "Development release" --draft --target main 2>/dev/null || true + gh release create "$RELEASE_TAG" --title "${RELEASE_TAG} (${DISPLAY_VERSION})" --notes "${STABILITY} release" --prerelease --target main 2>/dev/null || true # Upload ZIP to the major release gh release upload "$RELEASE_TAG" "/tmp/${PACKAGE_NAME}" --clobber 2>/dev/null || true