From faec9c67cce3c4e10607177f0486ec3647e3dda8 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 10 Feb 2024 15:08:27 -0600 Subject: [PATCH] ci: progress towards building on windows again --- .github/workflows/main.yml | 4 ++-- dl_sdl2.ps1 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 dl_sdl2.ps1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5eac398..d142935 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: paths: - "**.zig" + - "dl_sdl2.ps1" branches: - main schedule: @@ -29,9 +30,8 @@ jobs: - name: prepare-windows if: runner.os == 'Windows' run: | - vcpkg integrate install - vcpkg install sdl2:x64-windows git config --global core.autocrlf false + .\dl_sdl2.ps1 - name: prepare-macos if: runner.os == 'macOS' run: | diff --git a/dl_sdl2.ps1 b/dl_sdl2.ps1 new file mode 100644 index 0000000..88cc6e9 --- /dev/null +++ b/dl_sdl2.ps1 @@ -0,0 +1,32 @@ +$SDL2Version = "2.30.0" +$ArchiveFile = ".\SDL2-devel-mingw.zip" +$Json = @" +{ + "x86_64-windows-gnu": { + "include": "SDL2\\include", + "libs": "SDL2\\lib", + "bin": "SDL2\\bin" + } +} +"@ + +New-Item -Force -ItemType Directory -Path .\.build_config +Set-Location -Path .build_config -PassThru + +if (!(Test-Path -PathType Leaf $ArchiveFile)) { + Invoke-WebRequest "https://github.com/libsdl-org/SDL/releases/download/release-$SDL2Version/SDL2-devel-$SDL2Version-mingw.zip" -OutFile $ArchiveFile +} + +Expand-Archive $ArchiveFile + +if (Test-Path -PathType Leaf .\SDL2) { + Remove-Item -Recurse .\SDL2 +} + +New-Item -Force -ItemType Directory -Path .\SDL2 +Get-ChildItem -Path ".\SDL2-devel-mingw\SDL2-$SDL2Version\x86_64-w64-mingw32" | Move-Item -Destination .\SDL2 + +New-Item -Force .\sdl.json -Value $Json + +Remove-Item -Recurse .\SDL2-devel-mingw +Set-Location -Path .. -PassThru