-
Notifications
You must be signed in to change notification settings - Fork 20
69 lines (59 loc) · 2.13 KB
/
build_ffmpeg.yaml
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
60
61
62
63
64
65
66
67
68
69
# Taken and adapted from torchaudio.
# Ref: https://github.com/pytorch/audio/blob/main/.github/workflows/ffmpeg.yml
# This job is not directly related to regular CI pipeline.
# It is intended to create FFmpeg binaries that we upload on S3,
# which then will be used during all the build process in CI or local.
#
# This job does not include the uploading part.
# Upload needs to be done manually, and it should be done only once
# per new major release of FFmepg.
name: Build non-GPL FFmpeg from source
on:
workflow_dispatch:
pull_request:
paths:
- packaging/build_ffmpeg.sh
- .github/workflows/build_ffmpeg.yaml # self reference
schedule:
- cron: '0 0 * * 0' # on sunday
defaults:
run:
shell: bash -l -eo pipefail {0}
jobs:
LGPL-Linux-x86_64:
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
job-name: Build
upload-artifact: ffmpeg-lgpl
repository: pytorch/torchcodec
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"
packaging/build_ffmpeg.sh
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/linux_x86_64"
mkdir -p "${artifact_dir}"
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"
LGPL-macOS:
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
job-name: Build
upload-artifact: ffmpeg-lgpl
repository: pytorch/torchcodec
runner: macos-14-xlarge
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"
packaging/build_ffmpeg.sh
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/macos_$(uname -m)"
mkdir -p "${artifact_dir}"
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"