From 9c2de0b183dbb14e1d8483b8ddc2394ed9179b63 Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Wed, 4 Nov 2026 07:38:16 +0800 Subject: [PATCH 1/3] ci(notify): say why an existing FFmpeg release was updated --- .github/workflows/mirror.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 656a6b0..7bd8ad9 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -267,6 +267,9 @@ jobs: GH_REPO: ${{ github.repository }} VERSION: ${{ needs.resolve.outputs.version }} BRANCH: ${{ needs.resolve.outputs.btbn_branch }} + EVENT: ${{ github.event_name }} + # Commit text is untrusted: read it from env, never interpolate it into the script. + HEAD_MSG: ${{ github.event.head_commit.message }} steps: - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 with: @@ -327,10 +330,22 @@ jobs: else platforms="Linux (linux64, linuxarm64); Windows is not available yet" fi + # An update keeps the version, so say what changed. The cron only updates to backfill Windows. + reason="" + if [ "$ACTION" = updated ]; then + case "$EVENT" in + push) + subject="${HEAD_MSG%%$'\n'*}" + subject=$(sed -E 's/\r$//; s/^[a-z]+(\([^)]*\))?!?: //' <<< "$subject") + reason="Rebuilt after: ${subject:-a push to main}. " ;; + schedule) reason="Windows binaries added. " ;; + *) reason="Rebuilt by hand. " ;; + esac + fi { echo "published=true" echo "title=🚀 FFmpeg ${VERSION} (static) ${ACTION}" - echo "summary=${platforms}." + echo "summary=${reason}${platforms}." echo "url=${GITHUB_SERVER_URL}/${GH_REPO}/releases/tag/${TAG}" } >> "$GITHUB_OUTPUT" From b8060efab92345885e3c004d42965b19f0c6119e Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Wed, 4 Nov 2026 07:58:19 +0800 Subject: [PATCH 2/3] ci(notify): claim Windows binaries were added only when they are new to the release --- .github/workflows/mirror.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 7bd8ad9..80cc8d0 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -312,6 +312,7 @@ jobs: exit 0 fi ACTION=updated + had_win=$(gh release view "$TAG" --json assets --jq 'any(.assets[]; .name == "ffmpeg-win64.exe")' 2>/dev/null) || had_win=unknown gh release upload "$TAG" ffmpeg-* ffprobe-* SHA256SUMS --clobber # Keep title/notes/latest accurate too (not just assets). gh release edit "$TAG" \ @@ -330,7 +331,7 @@ jobs: else platforms="Linux (linux64, linuxarm64); Windows is not available yet" fi - # An update keeps the version, so say what changed. The cron only updates to backfill Windows. + # An update keeps the version, so say what changed. reason="" if [ "$ACTION" = updated ]; then case "$EVENT" in @@ -338,7 +339,12 @@ jobs: subject="${HEAD_MSG%%$'\n'*}" subject=$(sed -E 's/\r$//; s/^[a-z]+(\([^)]*\))?!?: //' <<< "$subject") reason="Rebuilt after: ${subject:-a push to main}. " ;; - schedule) reason="Windows binaries added. " ;; + schedule) + if [ "$had_win" = false ] && [ -e ffmpeg-win64.exe ]; then + reason="Windows binaries added. " + else + reason="Scheduled rebuild. " + fi ;; *) reason="Rebuilt by hand. " ;; esac fi From 222e1eadbe98ab6be9ad4ca839df04613d3fbb70 Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Wed, 4 Nov 2026 08:52:49 +0800 Subject: [PATCH 3/3] ci(notify): count Windows binaries as added only when any of the four was missing --- .github/workflows/mirror.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 80cc8d0..ad0f766 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -42,6 +42,10 @@ on: permissions: contents: read +env: + # Every Windows binary a complete release carries; the backfill gate and the notice both check all four. + WINDOWS_ASSETS: '["ffmpeg-win64.exe","ffprobe-win64.exe","ffmpeg-winarm64.exe","ffprobe-winarm64.exe"]' + jobs: resolve: runs-on: ubuntu-latest @@ -115,14 +119,13 @@ jobs: set -euo pipefail # All four, not just one: a partial upload must not read as complete, or # the missing binaries are never restored. Subtraction matches on equality. - WANT='["ffmpeg-win64.exe","ffprobe-win64.exe","ffmpeg-winarm64.exe","ffprobe-winarm64.exe"]' BUILD=true if [ "$EVENT" != "schedule" ]; then echo "Event ${EVENT} — building." elif ! gh release view "n${VERSION}" >/dev/null 2>&1; then echo "n${VERSION} is not published yet — building." elif [ "$(gh release view "n${VERSION}" --json assets \ - --jq "$WANT - [.assets[].name] | length == 0")" = true ]; then + --jq "$WINDOWS_ASSETS - [.assets[].name] | length == 0")" = true ]; then echo "n${VERSION} is published with every Windows binary — nothing to do." BUILD=false elif [ "$WIN_AVAIL" = true ]; then @@ -312,7 +315,7 @@ jobs: exit 0 fi ACTION=updated - had_win=$(gh release view "$TAG" --json assets --jq 'any(.assets[]; .name == "ffmpeg-win64.exe")' 2>/dev/null) || had_win=unknown + had_all_win=$(gh release view "$TAG" --json assets --jq "$WINDOWS_ASSETS - [.assets[].name] | length == 0" 2>/dev/null) || had_all_win=unknown gh release upload "$TAG" ffmpeg-* ffprobe-* SHA256SUMS --clobber # Keep title/notes/latest accurate too (not just assets). gh release edit "$TAG" \ @@ -340,7 +343,7 @@ jobs: subject=$(sed -E 's/\r$//; s/^[a-z]+(\([^)]*\))?!?: //' <<< "$subject") reason="Rebuilt after: ${subject:-a push to main}. " ;; schedule) - if [ "$had_win" = false ] && [ -e ffmpeg-win64.exe ]; then + if [ "$had_all_win" = false ] && [ -e ffmpeg-win64.exe ]; then reason="Windows binaries added. " else reason="Scheduled rebuild. "