Skip to content

Commit 07ca438

Browse files
author
amin
committed
update ci and add restriction for composer.json
1 parent 051ba6d commit 07ca438

File tree

2 files changed

+62
-52
lines changed

2 files changed

+62
-52
lines changed

.github/workflows/test.yml

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ubuntu-latest, macos-latest, windows-latest]
17+
os: [ubuntu-latest]
18+
# os: [ubuntu-latest, macos-latest, windows-latest]
1819

1920
steps:
2021
- uses: actions/checkout@v4
@@ -63,57 +64,57 @@ jobs:
6364
sudo ldconfig
6465
ffmpeg -version
6566
66-
- name: Install FFmpeg 7.1.1 on macOS (build from source)
67-
if: matrix.os == 'macos-latest'
68-
run: |
69-
brew update
70-
brew install automake fdk-aac git lame libass libvorbis libvpx opus sdl2 texi2html theora x264 x265 cmake pkg-config
71-
72-
# Cleanup old FFmpeg directory if present
73-
rm -rf FFmpeg
74-
75-
# Set pkg-config path for Homebrew
76-
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/lame/lib/pkgconfig:$PKG_CONFIG_PATH"
77-
export LDFLAGS="-L/opt/homebrew/lib"
78-
export CPPFLAGS="-I/opt/homebrew/include"
79-
80-
git clone https://github.com/FFmpeg/FFmpeg.git
81-
cd FFmpeg
82-
git checkout n7.1.1
83-
84-
./configure --prefix=/usr/local --enable-gpl --enable-nonfree \
85-
--enable-shared \
86-
--enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame \
87-
--enable-libfdk-aac --enable-libopus
88-
89-
make -j$(sysctl -n hw.logicalcpu)
90-
sudo make install
91-
ffmpeg -version
92-
ls -lh /usr/local/lib/libav*.dylib
93-
94-
- name: Install FFmpeg 7.1.1 on Windows (custom build)
95-
if: matrix.os == 'windows-latest'
96-
shell: powershell
97-
run: |
98-
if (Test-Path ffmpeg) {
99-
Remove-Item -Recurse -Force ffmpeg
100-
}
101-
102-
Invoke-WebRequest -Uri https://github.com/PHP-WebRTC/ffmpeg-builder/releases/download/v7.1.1/ffmpeg-win_amd64.tar.gz -OutFile ffmpeg.tar.gz
103-
mkdir ffmpeg
104-
tar -xzf ffmpeg.tar.gz -C ffmpeg
105-
106-
# Add lib folder containing DLLs to PATH
107-
echo "${{ github.workspace }}\ffmpeg\lib" | Out-File -Append $env:GITHUB_PATH
108-
109-
# Check ffmpeg version from bin if available
110-
if (Test-Path "${{ github.workspace }}\ffmpeg\bin\ffmpeg.exe") {
111-
& "${{ github.workspace }}\ffmpeg\bin\ffmpeg.exe" -version
112-
} elseif (Test-Path "${{ github.workspace }}\ffmpeg\lib\ffmpeg.exe") {
113-
& "${{ github.workspace }}\ffmpeg\lib\ffmpeg.exe" -version
114-
} else {
115-
Write-Host "ffmpeg.exe not found."
116-
}
67+
# - name: Install FFmpeg 7.1.1 on macOS (build from source)
68+
# if: matrix.os == 'macos-latest'
69+
# run: |
70+
# brew update
71+
# brew install automake fdk-aac git lame libass libvorbis libvpx opus sdl2 texi2html theora x264 x265 cmake pkg-config
72+
#
73+
# # Cleanup old FFmpeg directory if present
74+
# rm -rf FFmpeg
75+
#
76+
# # Set pkg-config path for Homebrew
77+
# export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/lame/lib/pkgconfig:$PKG_CONFIG_PATH"
78+
# export LDFLAGS="-L/opt/homebrew/lib"
79+
# export CPPFLAGS="-I/opt/homebrew/include"
80+
#
81+
# git clone https://github.com/FFmpeg/FFmpeg.git
82+
# cd FFmpeg
83+
# git checkout n7.1.1
84+
#
85+
# ./configure --prefix=/usr/local --enable-gpl --enable-nonfree \
86+
# --enable-shared \
87+
# --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame \
88+
# --enable-libfdk-aac --enable-libopus
89+
#
90+
# make -j$(sysctl -n hw.logicalcpu)
91+
# sudo make install
92+
# ffmpeg -version
93+
# ls -lh /usr/local/lib/libav*.dylib
94+
95+
# - name: Install FFmpeg 7.1.1 on Windows (custom build)
96+
# if: matrix.os == 'windows-latest'
97+
# shell: powershell
98+
# run: |
99+
# if (Test-Path ffmpeg) {
100+
# Remove-Item -Recurse -Force ffmpeg
101+
# }
102+
#
103+
# Invoke-WebRequest -Uri https://github.com/PHP-WebRTC/ffmpeg-builder/releases/download/v7.1.1/ffmpeg-win_amd64.tar.gz -OutFile ffmpeg.tar.gz
104+
# mkdir ffmpeg
105+
# tar -xzf ffmpeg.tar.gz -C ffmpeg
106+
#
107+
# # Add lib folder containing DLLs to PATH
108+
# echo "${{ github.workspace }}\ffmpeg\lib" | Out-File -Append $env:GITHUB_PATH
109+
#
110+
# # Check ffmpeg version from bin if available
111+
# if (Test-Path "${{ github.workspace }}\ffmpeg\bin\ffmpeg.exe") {
112+
# & "${{ github.workspace }}\ffmpeg\bin\ffmpeg.exe" -version
113+
# } elseif (Test-Path "${{ github.workspace }}\ffmpeg\lib\ffmpeg.exe") {
114+
# & "${{ github.workspace }}\ffmpeg\lib\ffmpeg.exe" -version
115+
# } else {
116+
# Write-Host "ffmpeg.exe not found."
117+
# }
117118

118119
- name: Check PHP and FFI status
119120
run: |

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@
5454
"scripts": {
5555
"setup-ffmpeg": [
5656
"php scripts/ffmpeg-downloader.php"
57+
],
58+
"pre-install-cmd": [
59+
"@check-linux"
60+
],
61+
"pre-update-cmd": [
62+
"@check-linux"
63+
],
64+
"check-linux": [
65+
"php -r \"if (stripos(PHP_OS_FAMILY, 'Linux') === false) { fwrite(STDERR, 'This package only supports Linux.' . PHP_EOL); exit(1); }\""
5766
]
5867
},
5968
"minimum-stability": "dev"

0 commit comments

Comments
 (0)