-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathaction.yml
More file actions
59 lines (52 loc) · 2.19 KB
/
Copy pathaction.yml
File metadata and controls
59 lines (52 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Setup FFmpeg and FFprobe
description: Install FFmpeg and FFprobe across Linux, macOS, and Windows
inputs:
ffmpeg-version:
description: FFmpeg version to install
required: true
runs:
using: composite
steps:
- name: Install FFmpeg and FFprobe
shell: bash
run: |
set -euo pipefail
FF_VERSION="${{ inputs.ffmpeg-version }}"
INSTALL_DIR="$HOME/ffmpeg"
mkdir -p "$INSTALL_DIR"
echo "Installing FFmpeg and FFprobe $FF_VERSION on ${{ runner.os }}"
if [[ "${{ runner.os }}" == "Linux" ]]; then
docker pull mwader/static-ffmpeg:$FF_VERSION
CID=$(docker create mwader/static-ffmpeg:$FF_VERSION)
docker cp "$CID:/ffmpeg" "$INSTALL_DIR/ffmpeg"
docker cp "$CID:/ffprobe" "$INSTALL_DIR/ffprobe"
docker rm "$CID"
chmod +x "$INSTALL_DIR/"*
elif [[ "${{ runner.os }}" == "macOS" ]]; then
FF_VERSION=$(echo "$FF_VERSION" | awk -F. '{print $1 $2}')
curl -sS -L --retry 3 --retry-delay 5 \
"https://www.osxexperts.net/ffmpeg${FF_VERSION}arm.zip" \
-o ffmpeg.zip -w "Downloaded FFmpeg from %{url_effective}\n"
unzip -q ffmpeg.zip
mv ffmpeg "$INSTALL_DIR/ffmpeg"
curl -sS -L --retry 3 --retry-delay 5 \
"https://www.osxexperts.net/ffprobe${FF_VERSION}arm.zip" \
-o ffprobe.zip -w "Downloaded FFprobe from %{url_effective}"
unzip -q ffprobe.zip
mv ffprobe "$INSTALL_DIR/ffprobe"
chmod +x "$INSTALL_DIR/"*
rm -f ffmpeg.zip ffprobe.zip
elif [[ "${{ runner.os }}" == "Windows" ]]; then
curl -sS -L --retry 3 --retry-delay 5 \
"https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-$FF_VERSION-essentials_build.zip" \
-o ffmpeg.zip -w "Downloaded FFmpeg and FFprobe from %{url_effective}"
unzip -q ffmpeg.zip
find . -type f \( -name ffmpeg.exe -o -name ffprobe.exe \) -exec mv {} "$INSTALL_DIR/" \;
rm -f ffmpeg.zip
fi
echo "$INSTALL_DIR" >> "$GITHUB_PATH"
- name: Verify FFmpeg and FFprobe installations
shell: bash
run: |
ffmpeg -version
ffprobe -version