@@ -31,18 +31,40 @@ jobs:
3131 - name : Publish
3232 run : dotnet publish AirPlay/AirPlay.csproj --configuration Release --runtime win-x64 --self-contained true --output ./publish/win-x64
3333
34+ - name : Cache FFmpeg
35+ id : cache-ffmpeg
36+ uses : actions/cache@v4
37+ with :
38+ path : ffmpeg-cache
39+ key : ffmpeg-win64-gpl-v1
40+
3441 - name : Download FFmpeg
42+ if : steps.cache-ffmpeg.outputs.cache-hit != 'true'
3543 shell : pwsh
3644 run : |
3745 $ffmpegUrl = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip"
3846 Invoke-WebRequest -Uri $ffmpegUrl -OutFile ffmpeg.zip
3947 Expand-Archive -Path ffmpeg.zip -DestinationPath ffmpeg-tmp
40- # Copy ffmpeg.exe and ffplay.exe to publish directory
4148 $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/
49+ New-Item -ItemType Directory -Force -Path ffmpeg-cache
50+ Copy-Item "$($binDir.FullName)\ffmpeg.exe" -Destination ffmpeg-cache/
51+ Copy-Item "$($binDir.FullName)\ffplay.exe" -Destination ffmpeg-cache/
52+
53+ - name : Copy FFmpeg to publish
54+ shell : pwsh
55+ run : |
56+ Copy-Item "ffmpeg-cache\ffmpeg.exe" -Destination ./publish/win-x64/
57+ Copy-Item "ffmpeg-cache\ffplay.exe" -Destination ./publish/win-x64/
58+
59+ - name : Cache libfdk-aac
60+ id : cache-fdkaac
61+ uses : actions/cache@v4
62+ with :
63+ path : fdkaac-cache
64+ key : fdkaac-win64-v1
4465
4566 - name : Build libfdk-aac from source
67+ if : steps.cache-fdkaac.outputs.cache-hit != 'true'
4668 shell : bash
4769 run : |
4870 # Build FDK-AAC from official source using MSYS2 (pre-installed on windows-latest)
@@ -61,16 +83,21 @@ jobs:
6183 cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
6284 cmake --build . --config Release
6385
64- # Find and copy the DLL
86+ # Find and copy the DLL to cache
6587 echo "Built files:"
6688 find . -name "*.dll" -type f
6789 DLL_PATH=$(find . -name "fdk-aac*.dll" -o -name "libfdk-aac*.dll" | head -1)
6890 if [ -z "$DLL_PATH" ]; then
6991 echo "ERROR: No FDK-AAC DLL found after build"
7092 exit 1
7193 fi
72- cp -v "$DLL_PATH" ../../publish/win-x64/libfdk-aac-2.dll
73- echo "Successfully built and copied libfdk-aac-2.dll"
94+ mkdir -p ../../fdkaac-cache
95+ cp -v "$DLL_PATH" ../../fdkaac-cache/libfdk-aac-2.dll
96+ echo "Successfully built and cached libfdk-aac-2.dll"
97+
98+ - name : Copy libfdk-aac to publish
99+ shell : bash
100+ run : cp -v fdkaac-cache/libfdk-aac-2.dll publish/win-x64/libfdk-aac-2.dll
74101
75102 - name : Upload build artifacts
76103 uses : actions/upload-artifact@v4
0 commit comments