Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/actions/static-ffmpeg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ runs:
env:
FFMPEG_VERSION: ${{ inputs.version }}
run: |
curl -LO "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz"
tar xf "ffmpeg-${FFMPEG_VERSION}.tar.xz"
# fetch-ffmpeg.sh retries and falls back to the GitHub mirror:
# ffmpeg.org resets from runners took out the v1.9.1 release.
bash "$GITHUB_ACTION_PATH/fetch-ffmpeg.sh"
cd "ffmpeg-${FFMPEG_VERSION}"
./configure --prefix="$GITHUB_WORKSPACE/ffmpeg-static" \
--disable-everything --disable-programs --disable-doc \
Expand All @@ -72,8 +73,9 @@ runs:
FFMPEG_VERSION: ${{ inputs.version }}
run: |
brew install nasm
curl -LO "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz"
tar xf "ffmpeg-${FFMPEG_VERSION}.tar.xz"
# fetch-ffmpeg.sh retries and falls back to the GitHub mirror:
# ffmpeg.org resets from runners took out the v1.9.1 release.
bash "$GITHUB_ACTION_PATH/fetch-ffmpeg.sh"
# --enable-cross-compile on the native slice too: it only turns
# off configure-time runtime probing, and keeps both invocations
# identical.
Expand Down
6 changes: 4 additions & 2 deletions .github/actions/static-ffmpeg/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ rm -f /usr/bin/link.exe

pacman -Sy --noconfirm --needed make nasm diffutils xz

curl -LO "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz"
tar xf "ffmpeg-${FFMPEG_VERSION}.tar.xz"
# fetch-ffmpeg.sh retries and falls back to the GitHub mirror:
# ffmpeg.org resets from the Windows runners took out the v1.9.1
# release twice, an hour apart.
bash "$(dirname "$0")/fetch-ffmpeg.sh"
cd "ffmpeg-${FFMPEG_VERSION}"

prefix="$(cygpath -u "$GITHUB_WORKSPACE")/ffmpeg-static"
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/static-ffmpeg/fetch-ffmpeg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Fetch and unpack the FFmpeg source into ./ffmpeg-$FFMPEG_VERSION.
# ffmpeg.org first (the canonical release tarball), then the GitHub tag
# archive: ffmpeg.org reset connections from the Windows runners for
# over an hour straight (it failed the v1.9.1 release's Windows job
# twice, an hour apart), and tag n<version> is the same source served
# from infrastructure Actions runners can always reach.
set -euo pipefail

fetch() {
curl -fL --retry 5 --retry-delay 2 --retry-all-errors -o "$2" "$1"
}

if fetch "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz" \
"ffmpeg-${FFMPEG_VERSION}.tar.xz"; then
tar xf "ffmpeg-${FFMPEG_VERSION}.tar.xz"
else
echo "ffmpeg.org unreachable, using the GitHub mirror" >&2
fetch "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${FFMPEG_VERSION}.tar.gz" \
"ffmpeg-github.tar.gz"
tar xf ffmpeg-github.tar.gz
mv "FFmpeg-n${FFMPEG_VERSION}" "ffmpeg-${FFMPEG_VERSION}"
fi
Loading