Files
sx/.github/workflows/build.yml
2026-02-09 22:24:06 +02:00

55 lines
1.6 KiB
YAML

name: Build
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: master # pin to a specific version once stable
- name: Download LLVM 18
run: |
Invoke-WebRequest -Uri "https://github.com/vovkos/llvm-package-windows/releases/download/llvm-18.1.8/llvm-18.1.8-windows-amd64-msvc17-msvcrt.7z" -OutFile "$env:TEMP\llvm.7z"
7z x "$env:TEMP\llvm.7z" -oC:\LLVM
- name: Verify LLVM
run: |
Get-ChildItem C:\LLVM -Recurse -Name "*.lib" | Select-Object -First 5
Get-ChildItem C:\LLVM -Directory
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: zig build -Dstatic-llvm -Dllvm-prefix="C:\LLVM\llvm-18.1.8-windows-amd64-msvc17-msvcrt" -Dtarget=x86_64-windows-msvc
- name: Test
continue-on-error: true
run: zig build test -Dstatic-llvm -Dllvm-prefix="C:\LLVM\llvm-18.1.8-windows-amd64-msvc17-msvcrt" -Dtarget=x86_64-windows-msvc --summary all
- name: Package
run: Compress-Archive -Path zig-out\bin\* -DestinationPath sx-windows-x86_64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sx-windows-x86_64
path: zig-out/bin/
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: sx-windows-x86_64.zip