Fix: release workflow pushes updates.xml to main automatically
When running from a non-main branch (e.g. dev), the workflow now cherry-picks the updates.xml change to main so the Joomla update server always has the latest SHA and download URLs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@@ -367,19 +367,39 @@ jobs:
|
||||
print(f"Updated {xml_tag} channel: version={version}, sha={sha256[:16]}..., date={date}")
|
||||
PYEOF
|
||||
|
||||
- name: "Commit updates.xml"
|
||||
- name: "Commit updates.xml to current branch and main"
|
||||
run: |
|
||||
if git diff --quiet updates.xml 2>/dev/null; then
|
||||
echo "No changes to updates.xml"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||
VERSION="${{ steps.meta.outputs.version }}"
|
||||
CURRENT_BRANCH="${{ github.ref_name }}"
|
||||
TOKEN="${{ secrets.GA_TOKEN }}"
|
||||
|
||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||
git config --local user.name "gitea-actions[bot]"
|
||||
git add updates.xml
|
||||
git commit -m "chore: update ${STABILITY} SHA-256 for ${{ steps.meta.outputs.version }} [skip ci]" \
|
||||
git commit -m "chore: update ${STABILITY} SHA-256 for ${VERSION} [skip ci]" \
|
||||
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||
|
||||
# Push to current branch
|
||||
git push || true
|
||||
|
||||
# Also push updates.xml to main (where the update server reads from)
|
||||
if [ "$CURRENT_BRANCH" != "main" ]; then
|
||||
git fetch origin main
|
||||
git checkout main
|
||||
git checkout "$CURRENT_BRANCH" -- updates.xml
|
||||
git add updates.xml
|
||||
git commit -m "chore: update ${STABILITY} channel to ${VERSION} on main [skip ci]" \
|
||||
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>" || true
|
||||
git push origin main || true
|
||||
git checkout "$CURRENT_BRANCH"
|
||||
fi
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
VERSION="${{ steps.meta.outputs.version }}"
|
||||
|
||||
Reference in New Issue
Block a user