Skip to content

ci: add windows build action #17

ci: add windows build action

ci: add windows build action #17

Workflow file for this run

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: Download sdl2
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL
latest: true
fileName: '*win*x64*.zip'
out-file-path: sdl2-binary
extract: true
- name: Download sdl2-mixer
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_mixer
latest: true
fileName: '*win*x64*.zip'
out-file-path: sdl2-mixer-binary
extract: true
- name: Download sdl2-ttf
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_ttf
latest: true
fileName: '*win*x64*.zip'
out-file-path: sdl2-ttf-binary
extract: true
- name: Download sdl2-image
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_image
latest: true
fileName: '*win*x64*.zip'
out-file-path: sdl2-image-binary
extract: true
- name: Download sdl2 development files
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL
latest: true
fileName: '*devel*VC*.zip'
out-file-path: sdl2-dev
extract: true
- name: Download sdl2-mixer development files
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_mixer
latest: true
fileName: '*devel*VC*.zip'
out-file-path: sdl2-mixer-dev
extract: true
- name: Download sdl2-ttf development files
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_ttf
latest: true
fileName: '*devel*VC*.zip'
out-file-path: sdl2-ttf-dev
extract: true
- name: Download sdl2-image development files
uses: robinraju/release-downloader@v1.10
with:
repository: libsdl-org/SDL_image
latest: true
fileName: '*devel*VC*.zip'
out-file-path: sdl2-image-dev
extract: true
- name: Copy sdl2 library files
run: |
mkdir sdl2-libs
copy sdl2-binary/*.dll sdl2-libs
copy sdl2-mixer-binary/*.dll sdl2-libs
copy sdl2-mixer-binary/optional/*.dll sdl2-libs
copy sdl2-image-binary/*.dll sdl2-libs
copy sdl2-image-binary/optional/*.dll sdl2-libs
copy sdl2-ttf-binary/*.dll sdl2-libs
Get-ChildItem -Recurse sdl2-libs
- name: Copy sdl2 development files
run: |
mkdir sdl2-dev-libs
cd sdl2-dev/SDL2*
copy lib/x64/*.dll ../../sdl2-dev-libs
copy lib/x64/*.lib ../../sdl2-dev-libs
cd ../../sdl2-mixer-dev/SDL2*
copy lib/x64/*.dll ../../sdl2-dev-libs
copy lib/x64/optional/*.dll ../../sdl2-dev-libs
copy lib/x64/*.lib ../../sdl2-dev-libs
copy lib/x64/optional/*.lib ../../sdl2-dev-libs
cd ../../sdl2-image-dev/SDL2*
copy lib/x64/*.dll ../../sdl2-dev-libs
copy lib/x64/optional/*.dll ../../sdl2-dev-libs
copy lib/x64/*.lib ../../sdl2-dev-libs
copy lib/x64/optional/*.lib ../../sdl2-dev-libs
cd ../../sdl2-ttf-dev/SDL2*
copy lib/x64/*.dll ../../sdl2-dev-libs
copy lib/x64/*.lib ../../sdl2-dev-libs
cd ../..
Get-ChildItem -Recurse sdl2-dev-libs
- name: Build
run: |
$env:Path += ";" + $pwd + "\sdl2-dev-libs"
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