Merge pull request #5 from YimingZhanshen/copilot/fix-screen-mirrorin… #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore AirPlay.sln | |
| - name: Build | |
| run: dotnet build AirPlay.sln --configuration Release --no-restore | |
| - name: Publish | |
| run: dotnet publish AirPlay/AirPlay.csproj --configuration Release --runtime win-x64 --self-contained true --output ./publish/win-x64 | |
| - name: Download FFmpeg | |
| shell: pwsh | |
| run: | | |
| $ffmpegUrl = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" | |
| Invoke-WebRequest -Uri $ffmpegUrl -OutFile ffmpeg.zip | |
| Expand-Archive -Path ffmpeg.zip -DestinationPath ffmpeg-tmp | |
| # Copy ffmpeg.exe and ffplay.exe to publish directory | |
| $binDir = Get-ChildItem -Path ffmpeg-tmp -Recurse -Directory -Filter "bin" | Select-Object -First 1 | |
| Copy-Item "$($binDir.FullName)\ffmpeg.exe" -Destination ./publish/win-x64/ | |
| Copy-Item "$($binDir.FullName)\ffplay.exe" -Destination ./publish/win-x64/ | |
| - name: Build libfdk-aac from source | |
| shell: bash | |
| run: | | |
| # Build FDK-AAC from official source using MSYS2 (pre-installed on windows-latest) | |
| export MSYSTEM=MINGW64 | |
| export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin:$PATH" | |
| # Install build dependencies | |
| pacman -S --noconfirm --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make | |
| # Clone and build fdk-aac | |
| git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git fdk-aac-src | |
| cd fdk-aac-src | |
| # Use CMake for a simpler build | |
| mkdir build && cd build | |
| cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .. | |
| cmake --build . --config Release | |
| # Find and copy the DLL | |
| echo "Built files:" | |
| find . -name "*.dll" -type f | |
| DLL_PATH=$(find . -name "fdk-aac*.dll" -o -name "libfdk-aac*.dll" | head -1) | |
| if [ -z "$DLL_PATH" ]; then | |
| echo "ERROR: No FDK-AAC DLL found after build" | |
| exit 1 | |
| fi | |
| cp -v "$DLL_PATH" ../../publish/win-x64/libfdk-aac-2.dll | |
| echo "Successfully built and copied libfdk-aac-2.dll" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AirPlay-win-x64 | |
| path: ./publish/win-x64/ |