|
31 | 31 | - name: Publish |
32 | 32 | run: dotnet publish AirPlay/AirPlay.csproj --configuration Release --runtime win-x64 --self-contained true --output ./publish/win-x64 |
33 | 33 |
|
| 34 | + - name: Download FFmpeg |
| 35 | + shell: pwsh |
| 36 | + run: | |
| 37 | + $ffmpegUrl = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" |
| 38 | + Invoke-WebRequest -Uri $ffmpegUrl -OutFile ffmpeg.zip |
| 39 | + Expand-Archive -Path ffmpeg.zip -DestinationPath ffmpeg-tmp |
| 40 | + # Copy ffmpeg.exe and ffplay.exe to publish directory |
| 41 | + $binDir = Get-ChildItem -Path ffmpeg-tmp -Recurse -Directory -Filter "bin" | Select-Object -First 1 |
| 42 | + Copy-Item "$($binDir.FullName)\ffmpeg.exe" -Destination ./publish/win-x64/ |
| 43 | + Copy-Item "$($binDir.FullName)\ffplay.exe" -Destination ./publish/win-x64/ |
| 44 | +
|
| 45 | + - name: Build libfdk-aac from source |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + # Build FDK-AAC from official source using MSYS2 (pre-installed on windows-latest) |
| 49 | + export MSYSTEM=MINGW64 |
| 50 | + export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin:$PATH" |
| 51 | +
|
| 52 | + # Install build dependencies |
| 53 | + pacman -S --noconfirm --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make |
| 54 | +
|
| 55 | + # Clone and build fdk-aac |
| 56 | + git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git fdk-aac-src |
| 57 | + cd fdk-aac-src |
| 58 | +
|
| 59 | + # Use CMake for a simpler build |
| 60 | + mkdir build && cd build |
| 61 | + cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .. |
| 62 | + cmake --build . --config Release |
| 63 | +
|
| 64 | + # Find and copy the DLL |
| 65 | + echo "Built files:" |
| 66 | + find . -name "*.dll" -type f |
| 67 | + DLL_PATH=$(find . -name "fdk-aac*.dll" -o -name "libfdk-aac*.dll" | head -1) |
| 68 | + if [ -z "$DLL_PATH" ]; then |
| 69 | + echo "ERROR: No FDK-AAC DLL found after build" |
| 70 | + exit 1 |
| 71 | + fi |
| 72 | + cp -v "$DLL_PATH" ../../publish/win-x64/libfdk-aac-2.dll |
| 73 | + echo "Successfully built and copied libfdk-aac-2.dll" |
| 74 | +
|
34 | 75 | - name: Upload build artifacts |
35 | 76 | uses: actions/upload-artifact@v4 |
36 | 77 | with: |
|
0 commit comments