From 4b0efe017b6a4f94186293cefda0e0baf1ba7353 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Mon, 10 Aug 2026 19:56:03 +0200 Subject: [PATCH 20/59] mono-update: --force flag to release the current base Needed for the inaugural release (base == latest, nothing to rebase) and for re-releasing after local-only changes; the rest of the flow - tag, build with baked identity, artifacts, publish, forge release - runs identically to a real upstream-triggered run. Co-Authored-By: Claude Fable 5 --- scripts/mono-update.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/mono-update.sh b/scripts/mono-update.sh index 64d9d5fc29..fbfcd787f3 100755 --- a/scripts/mono-update.sh +++ b/scripts/mono-update.sh @@ -8,12 +8,21 @@ # MONO_PUBLISH_DEST rsync destination (e.g. host:/srv/openwrt) # MONO_PUBLISH_URL public base URL written into latest.json # -# Usage: scripts/mono-update.sh [--dry-run] +# Usage: scripts/mono-update.sh [--dry-run] [--force] +# --force: release the current base even when already up to date +# (first release, or re-release after local-only changes) set -eu cd "$(dirname "$0")/.." BRANCH=mono -DRY_RUN=${1:-} +DRY_RUN="" +FORCE="" +for a in "$@"; do + case "$a" in + --dry-run) DRY_RUN=1 ;; + --force) FORCE=1 ;; + esac +done [ "$(git branch --show-current)" = "$BRANCH" ] || { echo "mono-update: not on branch $BRANCH, refusing" >&2 @@ -30,19 +39,21 @@ BASE=$(git tag --merged "$BRANCH" 'v[0-9]*' | sort -V | tail -1) SERIES=${BASE%.*} LATEST=$(git tag -l "${SERIES}.*" | sort -V | tail -1) -if [ "$LATEST" = "$BASE" ]; then +if [ "$LATEST" = "$BASE" ] && [ -z "$FORCE" ]; then echo "mono-update: up to date (base $BASE)" exit 0 fi echo "mono-update: $BASE -> $LATEST" -[ "$DRY_RUN" = "--dry-run" ] && exit 0 - -if ! git rebase --onto "$LATEST" "$BASE" "$BRANCH"; then - git rebase --abort - echo "mono-update: REBASE CONFLICT rebasing onto $LATEST - resolve manually:" >&2 - echo " git rebase --onto $LATEST $BASE $BRANCH" >&2 - exit 1 +[ -n "$DRY_RUN" ] && exit 0 + +if [ "$LATEST" != "$BASE" ]; then + if ! git rebase --onto "$LATEST" "$BASE" "$BRANCH"; then + git rebase --abort + echo "mono-update: REBASE CONFLICT rebasing onto $LATEST - resolve manually:" >&2 + echo " git rebase --onto $LATEST $BASE $BRANCH" >&2 + exit 1 + fi fi # Tag before building so the image can bake its own release identity -- 2.47.3