From e12e9ba01b7a28c6b231a6e0b3f1352a00bff333 Mon Sep 17 00:00:00 2001 From: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:28:50 +0000 Subject: [PATCH] fix(scripts): align release script with Gitea staging-dev and stable branch workflow Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> --- scripts/release-stable.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/scripts/release-stable.sh b/scripts/release-stable.sh index d02fb5c..32da184 100755 --- a/scripts/release-stable.sh +++ b/scripts/release-stable.sh @@ -155,12 +155,13 @@ if [[ ! "$confirm" =~ ^[Yy]$ ]]; then fi # ───────────────────────────────────────────────────────────────────────────── -# Step 1: Push main to stable +# Step 1: Push tested code to Gitea (stable & staging-dev) # ───────────────────────────────────────────────────────────────────────────── echo -echo -e "${BLUE}Step 1: Pushing main → stable on Gitea...${NC}" +echo -e "${BLUE}Step 1: Pushing tested code to Gitea (stable & staging-dev)...${NC}" if git remote | grep -q -x "${GITEA_REMOTE}"; then - git push "${GITEA_REMOTE}" main:stable --force-with-lease || echo -e " ${YELLOW}⚠ Push to ${GITEA_REMOTE} failed.${NC}" + git push "${GITEA_REMOTE}" HEAD:stable --force-with-lease || echo -e " ${YELLOW}⚠ Push to ${GITEA_REMOTE} (stable) failed.${NC}" + git push "${GITEA_REMOTE}" HEAD:staging-dev --force-with-lease || echo -e " ${YELLOW}⚠ Push to ${GITEA_REMOTE} (staging-dev) failed.${NC}" else echo -e " ${YELLOW}⚠ Remote '${GITEA_REMOTE}' not found in git — skipping Gitea push.${NC}" fi @@ -181,6 +182,10 @@ else echo -e " ${YELLOW}⚠ Remote '${GITEA_REMOTE}' not found in git — skipping Gitea tag push.${NC}" fi +if git remote | grep -q -x "${GITHUB_REMOTE}"; then + git push "${GITHUB_REMOTE}" "${TAG}" || echo -e " ${YELLOW}⚠ Tag push to ${GITHUB_REMOTE} failed.${NC}" +fi + # Update VERSION file for ISO builds echo "${VERSION}" > VERSION git add VERSION @@ -244,17 +249,23 @@ else # Ask if user wants to push echo - read -rp "Push the changelog commit to GitHub now? (y/N): " push_confirm + read -rp "Push the changelog commit to GitHub (main) and Gitea (staging-dev) now? (y/N): " push_confirm if [[ "$push_confirm" =~ ^[Yy]$ ]]; then if git remote | grep -q -x "${GITHUB_REMOTE}"; then - echo -e "${BLUE}Pushing changelog commit...${NC}" - if git push "${GITHUB_REMOTE}" main; then - echo -e " ${GREEN}✓${NC} Changelog pushed to GitHub (${GITHUB_REMOTE})" + echo -e "${BLUE}Pushing changelog commit to GitHub main...${NC}" + if git push "${GITHUB_REMOTE}" HEAD:main; then + echo -e " ${GREEN}✓${NC} Changelog pushed to GitHub main (${GITHUB_REMOTE})" else - echo -e " ${YELLOW}⚠ Push to GitHub failed — verify credentials or remote name.${NC}" + echo -e " ${YELLOW}⚠ Push to GitHub main failed — verify credentials or remote name.${NC}" + fi + fi + if git remote | grep -q -x "${GITEA_REMOTE}"; then + echo -e "${BLUE}Pushing changelog commit to Gitea staging-dev...${NC}" + if git push "${GITEA_REMOTE}" HEAD:staging-dev; then + echo -e " ${GREEN}✓${NC} Changelog pushed to Gitea staging-dev (${GITEA_REMOTE})" + else + echo -e " ${YELLOW}⚠ Push to Gitea staging-dev failed.${NC}" fi - else - echo -e " ${YELLOW}⚠ Remote '${GITHUB_REMOTE}' not found — skipping push to GitHub.${NC}" fi else echo " (Changelog commit left local — remember to push later)" @@ -332,7 +343,7 @@ echo -e "${GREEN}╚════════════════════ echo echo "Next manual steps (recommended):" echo " • Review and enhance the new section in CHANGELOG.md" -echo " • Push the changelog commit: git push origin main" +echo " • Push changes: git push ${GITHUB_REMOTE} HEAD:main && git push ${GITEA_REMOTE} HEAD:staging-dev" echo " • Verify releases on both GitHub and Gitea" echo echo -e "${CYAN}Tag created: ${TAG}${NC}"