From 673c828f50600b0a14ca468b4ecbcc3be0a84d0f Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Mon, 10 Aug 2026 20:02:05 +0200 Subject: [PATCH 21/59] mono-update: revision releases for branch-only changes ASK pin bumps and other commits that land between upstream stable tags now cut mono-vX.Y.Z-rN on the next cron run; a new upstream tag starts a fresh series. Up-to-date now means 'the newest release tag of the current base points at the branch head'. Co-Authored-By: Claude Fable 5 --- scripts/mono-update.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/scripts/mono-update.sh b/scripts/mono-update.sh index fbfcd787f3..1943c6a3c9 100755 --- a/scripts/mono-update.sh +++ b/scripts/mono-update.sh @@ -39,12 +39,28 @@ 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" ] && [ -z "$FORCE" ]; then - echo "mono-update: up to date (base $BASE)" - exit 0 +# Two release triggers: a new upstream stable tag (mono-vX.Y.Z), or new +# commits on the branch since the last release of the current base - +# ASK pin bumps, package fixes - which cut a revision (mono-vX.Y.Z-rN). +if [ "$LATEST" != "$BASE" ]; then + RELTAG="mono-$LATEST" + echo "mono-update: $BASE -> $LATEST ($RELTAG)" +else + LASTTAG=$(git tag -l "mono-$BASE" "mono-$BASE-r*" | sort -V | tail -1) + if [ -n "$LASTTAG" ] && [ -z "$FORCE" ] && \ + [ "$(git rev-parse "$LASTTAG^{commit}")" = "$(git rev-parse "$BRANCH")" ]; then + echo "mono-update: up to date ($LASTTAG at branch head)" + exit 0 + fi + if [ -z "$LASTTAG" ]; then + RELTAG="mono-$BASE" + elif [ "$LASTTAG" = "mono-$BASE" ]; then + RELTAG="mono-$BASE-r2" + else + RELTAG="mono-$BASE-r$(( ${LASTTAG##*-r} + 1 ))" + fi + echo "mono-update: new commits on $BASE -> $RELTAG" fi - -echo "mono-update: $BASE -> $LATEST" [ -n "$DRY_RUN" ] && exit 0 if [ "$LATEST" != "$BASE" ]; then @@ -58,7 +74,6 @@ fi # Tag before building so the image can bake its own release identity # (mono-update-check reads it at build time). Dropped again on failure. -RELTAG="mono-$LATEST" git tag -f "$RELTAG" cleanup_fail() { @@ -122,7 +137,7 @@ if git remote get-url mono >/dev/null 2>&1; then REPO=$(git remote get-url mono | sed -E 's#(git@[^:]+:|https://[^/]+/)##; s#\.git$##') gh release create "$RELTAG" --repo "$REPO" \ --title "$RELTAG" \ - --notes "Automated release tracking OpenWrt $LATEST." \ + --notes "Automated release: OpenWrt $LATEST base, branch $(git rev-parse --short "$BRANCH")." \ "$OUT"/*-sysupgrade.bin "$OUT"/*-emmc.img.gz "$OUT/sha256sums" \ || echo "mono-update: WARNING: GitHub release failed" >&2 fi -- 2.47.3