forked from PyAV-Org/pyav-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (161 loc) · 5.31 KB
/
build-ffmpeg.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: build-ffmpeg
on:
push:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
pull_request:
branches: main
paths-ignore:
- '**.md'
- '**.rst'
- '**.txt'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
arch: arm64
shell: bash
- os: macos-13
arch: x86_64
shell: bash
- os: ubuntu-latest
arch: i686
shell: bash
- os: ubuntu-latest
arch: x86_64
shell: bash
- os: windows-latest
arch: AMD64
shell: 'msys2 {0}'
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set deployment target for macOS 13
if: matrix.os == 'macos-13'
run: echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
- name: Set deployment target for macOS 14
if: matrix.os == 'macos-14'
run: echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
- name: Install packages for macOS
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
brew update
brew install pkg-config srt
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
install: base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-gperf mingw-w64-x86_64-nasm openssl-devel
path-type: inherit
release: false
- name: Build FFmpeg
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD_LINUX: |
yum update
yum install -y tcl cmake gcc gcc-c++
python scripts/build-ffmpeg.py /tmp/vendor --enable-gpl
CIBW_BEFORE_BUILD_MACOS: python scripts/build-ffmpeg.py /tmp/vendor --enable-gpl
CIBW_BEFORE_BUILD_WINDOWS: python scripts\build-ffmpeg.py C:\cibw\vendor --enable-gpl
CIBW_BUILD: cp39-*
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair --add-path C:\cibw\vendor\bin -w {dest_dir} {wheel}
CIBW_SKIP: "*musllinux*"
CIBW_TEST_COMMAND: python -c "import dummy"
run: |
pip install cibuildwheel delvewheel
cibuildwheel --output-dir output
rm -f output/*.whl
- name: Print config.log
if: ${{ failure() }}
run: cat /d/a/pyav-ffmpeg/pyav-ffmpeg/build/ffmpeg/build/ffbuild/config.log
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
- name: Upload FFmpeg
uses: actions/upload-artifact@v4
with:
name: output-${{ matrix.os }}-${{ matrix.arch }}
path: output/
build-qemu-stage-1:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
arch: [aarch64]
os: [ubuntu-latest]
env:
stage: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build FFmpeg dependencies
run: |
docker run -v $PWD:/project:rw --workdir=/project quay.io/pypa/manylinux2014_${{ matrix.arch }} bash -exc '
export PATH=/opt/python/cp39-cp39/bin:$PATH;
export CIBUILDWHEEL=1;
python scripts/build-ffmpeg.py /tmp/vendor --enable-gpl --stage ${{ env.stage }};
cp -ar /tmp/vendor /project;
'
shell: bash
- uses: actions/upload-artifact@v4
with:
name: stage-1-${{ matrix.os }}-${{ matrix.arch }}
path: vendor
build-qemu-stage-2:
needs: build-qemu-stage-1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
arch: [aarch64]
os: [ubuntu-latest]
env:
stage: 2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- uses: actions/download-artifact@v4
with:
name: stage-1-${{ matrix.os }}-${{ matrix.arch }}
path: vendor
- name: Build FFmpeg
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_ALL_LINUX: cp -ar vendor /tmp
CIBW_BEFORE_BUILD: python scripts/build-ffmpeg.py /tmp/vendor --enable-gpl --stage ${{ env.stage }}
CIBW_BUILD: cp39-*
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}
CIBW_SKIP: "*musllinux*"
CIBW_TEST_COMMAND: python -c "import dummy"
run: |
pip install cibuildwheel
cibuildwheel --output-dir output
rm -f output/*.whl
shell: bash
- name: Upload FFmpeg
uses: actions/upload-artifact@v4
with:
name: output-${{ matrix.os }}-${{ matrix.arch }}
path: output/