ci: progress towards building on windows again

This commit is contained in:
Rekai Nyangadzayi Musuka 2024-02-10 15:08:27 -06:00
parent 66192daf6c
commit 6d7b83b1c2
3 changed files with 42 additions and 9 deletions

View File

@ -4,6 +4,7 @@ on:
push: push:
paths: paths:
- "**.zig" - "**.zig"
- "dl_sdl2.ps1"
branches: branches:
- main - main
schedule: schedule:
@ -20,7 +21,12 @@ jobs:
steps: steps:
- uses: goto-bus-stop/setup-zig@v2 - uses: goto-bus-stop/setup-zig@v2
with: with:
version: 0.11.0 version: 0.12.0-dev.2063+804cee3b9
- run: |
git config --global core.autocrlf false
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare-linux - name: prepare-linux
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: | run: |
@ -29,16 +35,11 @@ jobs:
- name: prepare-windows - name: prepare-windows
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | run: |
vcpkg integrate install .\dl_sdl2.ps1
vcpkg install sdl2:x64-windows
git config --global core.autocrlf false
- name: prepare-macos - name: prepare-macos
if: runner.os == 'macOS' if: runner.os == 'macOS'
run: | run: |
brew install sdl2 brew install sdl2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build - name: build
run: zig build -Doptimize=ReleaseSafe -Dcpu=baseline run: zig build -Doptimize=ReleaseSafe -Dcpu=baseline
- name: prepare-executable - name: prepare-executable

View File

@ -30,8 +30,8 @@
.hash = "12207da7e1f5d6180666db9575f84373055b230cb4259a4b6310562293338dc10b9d", .hash = "12207da7e1f5d6180666db9575f84373055b230cb4259a4b6310562293338dc10b9d",
}, },
.@"zba-gdbstub" = .{ .@"zba-gdbstub" = .{
.url = "https://git.musuka.dev/paoda/zba-gdbstub/archive/8c3a166a5daa453c3627dda42bc169c20a470c68.tar.gz", .url = "https://git.musuka.dev/paoda/zba-gdbstub/archive/8d2c76e410357166f092008ff5c7f7f097a043a7.tar.gz",
.hash = "12201dd0f0ae0c9efc8928aedd6970738f146675b2b9cbe8190177e37d1d849a6b6d", .hash = "1220a171c7e14769386e3f4aab6aed53b5e176d654bdf1428a15b972effed750bf30",
}, },
.tomlz = .{ .tomlz = .{
.url = "https://github.com/paoda/tomlz/archive/f0aebccc31d48a131e57108cb05c8acfe4991eb8.tar.gz", .url = "https://github.com/paoda/tomlz/archive/f0aebccc31d48a131e57108cb05c8acfe4991eb8.tar.gz",

32
dl_sdl2.ps1 Normal file
View File

@ -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