inital windows build support

This commit is contained in:
Curt Bushko
2023-09-29 00:43:01 -04:00
parent 7c440dea5e
commit 837afab98f

View File

@ -68,6 +68,41 @@ jobs:
- name: Build Ghostty.app
run: cd macos && xcodebuild
build-windows:
runs-on: windows-2019
# this will not stop other jobs from running
continue-on-error: true
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# This could be from a script if we wanted to but inlining here for now
# in one place.
# Using powershell so that we do not need to install WSL components. Also,
# WSLv1 is only installed on Github runners.
- name: Install zig
shell: pwsh
run: |
# Get the zig version from build.zig so that it only needs to be updated
$fileContent = Get-Content -Path "build.zig" -Raw
$pattern = 'const required_zig = "(.*?)";'
$zigVersion = [regex]::Match($fileContent, $pattern).Groups[1].Value
Write-Output $version
$version = "zig-windows-x86_64-$zigVersion"
$uri = "https://ziglang.org/builds/$version.zip"
Invoke-WebRequest -Uri "$uri" -OutFile ".\zig-windows.zip"
Expand-Archive -Path ".\zig-windows.zip" -DestinationPath ".\" -Force
Remove-Item -Path ".\zig-windows.zip"
Rename-Item -Path ".\$version" -NewName ".\zig"
Write-Host "Zig installed."
./zig/zig.exe version
- name: Test Windows
shell: pwsh
run: ./zig/zig.exe build test
test:
strategy:
matrix: