diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml new file mode 100644 index 0000000..f240522 --- /dev/null +++ b/.github/workflows/win-build.yml @@ -0,0 +1,47 @@ +name: Build on Windows + +on: + push: + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Download FFmpeg binaries + uses: robinraju/release-downloader@v1.10 + with: + repository: BtbN/FFmpeg-Builds + latest: true + fileName: ffmpeg-n7*-win64-lgpl-shared*.zip + out-file-path: ffmpeg-binary + extract: true + - name: Install vcpkg + run: | + git clone https://github.com/microsoft/vcpkg + .\vcpkg\bootstrap-vcpkg.bat + - name: Install sdl2 + run: | + vcpkg install sdl2 sdl2-ttf sdl2-image sdl2-mixer + - name: Build + run: | + $env:PATH += ";" + $pwd + "\vcpkg\installed\x64-windows\bin" + $env:INCLUDE += ";" + $pwd + "\vcpkg\installed\x64-windows\include" + $env:LIB += ";" + $pwd + "\vcpkg\installed\x64-windows\lib" + cd ffmpeg-binary\* + $env:FFMPEG_DIR = $pwd + cd ..\..\ + cargo build --verbose + cargo build --release --verbose + - name: Upload compiled binaries + uses: actions/upload-artifact@v4 + with: + name: windows-release-binary + path: ./target \ No newline at end of file