ci: sync workflows [skip ci]
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
.github/workflows/auto-dev-issue.yml
vendored
26
.github/workflows/auto-dev-issue.yml
vendored
@@ -156,30 +156,22 @@ jobs:
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── RC: Create or update draft release ────────────────────────────
|
# ── RC: Create or update release-candidate release ──────────────
|
||||||
if [[ "$BRANCH" == rc/* ]]; then
|
if [[ "$BRANCH" == rc/* ]]; then
|
||||||
MAJOR=$(echo "$VERSION" | awk -F. '{print $1}')
|
RELEASE_TAG="release-candidate"
|
||||||
RELEASE_TAG="v${MAJOR}"
|
EXISTING=$(gh release view "$RELEASE_TAG" --json tagName -q .tagName 2>/dev/null || true)
|
||||||
DRAFT_EXISTS=$(gh release view "$RELEASE_TAG" --json isDraft -q .isDraft 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -z "$DRAFT_EXISTS" ]; then
|
if [ -z "$EXISTING" ]; then
|
||||||
# No release exists — create draft
|
|
||||||
gh release create "$RELEASE_TAG" \
|
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}" \
|
--notes "## Release Candidate ${VERSION}\n\nRC branch: \`${BRANCH}\`\nTracking issue: ${PARENT_URL}" \
|
||||||
--draft \
|
--prerelease \
|
||||||
--target main 2>/dev/null || true
|
--target main 2>/dev/null || true
|
||||||
echo "Draft release created: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY
|
echo "RC 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
|
|
||||||
else
|
else
|
||||||
# Release exists and is published — set back to draft for RC
|
|
||||||
gh release edit "$RELEASE_TAG" \
|
gh release edit "$RELEASE_TAG" \
|
||||||
--title "v${MAJOR} (RC: ${VERSION})" --draft 2>/dev/null || true
|
--title "release-candidate (${VERSION})" --prerelease 2>/dev/null || true
|
||||||
echo "Release ${RELEASE_TAG} set to draft for RC" >> $GITHUB_STEP_SUMMARY
|
echo "RC release updated: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
70
.github/workflows/auto-release.yml
vendored
70
.github/workflows/auto-release.yml
vendored
@@ -316,34 +316,60 @@ jobs:
|
|||||||
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/v${VERSION}/${EXT_ELEMENT}-${VERSION}.zip"
|
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/v${VERSION}/${EXT_ELEMENT}-${VERSION}.zip"
|
||||||
INFO_URL="https://github.com/${REPO}/releases/tag/v${VERSION}"
|
INFO_URL="https://github.com/${REPO}/releases/tag/v${VERSION}"
|
||||||
|
|
||||||
# -- Write updates.xml (stable release) --------------------------
|
# -- Build stable entry ──────────────────────────────────────
|
||||||
|
STABLE_ENTRY=$(cat <<XMLEOF
|
||||||
|
<update>
|
||||||
|
<name>${EXT_NAME}</name>
|
||||||
|
<description>${EXT_NAME} update</description>
|
||||||
|
<element>${EXT_ELEMENT}</element>
|
||||||
|
<type>${EXT_TYPE}</type>
|
||||||
|
<version>${VERSION}</version>
|
||||||
|
$([ -n "$CLIENT_TAG" ] && echo " ${CLIENT_TAG}")
|
||||||
|
$([ -n "$FOLDER_TAG" ] && echo " ${FOLDER_TAG}")
|
||||||
|
<tags>
|
||||||
|
<tag>stable</tag>
|
||||||
|
</tags>
|
||||||
|
<infourl title="${EXT_NAME}">${INFO_URL}</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">${DOWNLOAD_URL}</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
${TARGET_PLATFORM}
|
||||||
|
$([ -n "$PHP_TAG" ] && echo " ${PHP_TAG}")
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
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'( <update>.*?<tag>rc</tag>.*?</update>)', 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'( <update>.*?<tag>development</tag>.*?</update>)', c, re.DOTALL)
|
||||||
|
if m: print(m.group(1))
|
||||||
|
" 2>/dev/null || true)
|
||||||
|
fi
|
||||||
|
|
||||||
{
|
{
|
||||||
printf '%s\n' '<?xml version="1.0" encoding="utf-8"?>'
|
printf '%s\n' '<?xml version="1.0" encoding="utf-8"?>'
|
||||||
printf '%s\n' '<updates>'
|
printf '%s\n' '<updates>'
|
||||||
printf '%s\n' ' <update>'
|
echo "$STABLE_ENTRY"
|
||||||
printf '%s\n' " <name>${EXT_NAME}</name>"
|
[ -n "$RC_ENTRY" ] && echo "$RC_ENTRY"
|
||||||
printf '%s\n' " <description>${EXT_NAME} update</description>"
|
[ -n "$DEV_ENTRY" ] && echo "$DEV_ENTRY"
|
||||||
printf '%s\n' " <element>${EXT_ELEMENT}</element>"
|
|
||||||
printf '%s\n' " <type>${EXT_TYPE}</type>"
|
|
||||||
printf '%s\n' " <version>${VERSION}</version>"
|
|
||||||
[ -n "$CLIENT_TAG" ] && printf '%s\n' " ${CLIENT_TAG}"
|
|
||||||
[ -n "$FOLDER_TAG" ] && printf '%s\n' " ${FOLDER_TAG}"
|
|
||||||
printf '%s\n' ' <tags>'
|
|
||||||
printf '%s\n' ' <tag>stable</tag>'
|
|
||||||
printf '%s\n' ' </tags>'
|
|
||||||
printf '%s\n' " <infourl title=\"${EXT_NAME}\">${INFO_URL}</infourl>"
|
|
||||||
printf '%s\n' ' <downloads>'
|
|
||||||
printf '%s\n' " <downloadurl type=\"full\" format=\"zip\">${DOWNLOAD_URL}</downloadurl>"
|
|
||||||
printf '%s\n' ' </downloads>'
|
|
||||||
printf '%s\n' " ${TARGET_PLATFORM}"
|
|
||||||
[ -n "$PHP_TAG" ] && printf '%s\n' " ${PHP_TAG}"
|
|
||||||
printf '%s\n' ' <maintainer>Moko Consulting</maintainer>'
|
|
||||||
printf '%s\n' ' <maintainerurl>https://mokoconsulting.tech</maintainerurl>'
|
|
||||||
printf '%s\n' ' </update>'
|
|
||||||
printf '%s\n' '</updates>'
|
printf '%s\n' '</updates>'
|
||||||
} > updates.xml
|
} > 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 ---------------------------------------------------
|
# -- Commit all changes ---------------------------------------------------
|
||||||
- name: Commit release changes
|
- name: Commit release changes
|
||||||
|
|||||||
13
.github/workflows/update-server.yml
vendored
13
.github/workflows/update-server.yml
vendored
@@ -120,7 +120,16 @@ jobs:
|
|||||||
[ "$STABILITY" = "development" ] && DISPLAY_VERSION="${VERSION}-dev"
|
[ "$STABILITY" = "development" ] && DISPLAY_VERSION="${VERSION}-dev"
|
||||||
|
|
||||||
MAJOR=$(echo "$VERSION" | awk -F. '{print $1}')
|
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"
|
PACKAGE_NAME="${EXT_ELEMENT}-${DISPLAY_VERSION}.zip"
|
||||||
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${RELEASE_TAG}/${PACKAGE_NAME}"
|
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${RELEASE_TAG}/${PACKAGE_NAME}"
|
||||||
INFO_URL="https://github.com/${REPO}"
|
INFO_URL="https://github.com/${REPO}"
|
||||||
@@ -137,7 +146,7 @@ jobs:
|
|||||||
|
|
||||||
# Ensure draft release exists for this major
|
# Ensure draft release exists for this major
|
||||||
gh release view "$RELEASE_TAG" --json tagName > /dev/null 2>&1 || \
|
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
|
# Upload ZIP to the major release
|
||||||
gh release upload "$RELEASE_TAG" "/tmp/${PACKAGE_NAME}" --clobber 2>/dev/null || true
|
gh release upload "$RELEASE_TAG" "/tmp/${PACKAGE_NAME}" --clobber 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user