This commit is contained in:
agra
2026-02-11 21:22:03 +02:00
parent 9d96f05d3b
commit 9a2501f662
5 changed files with 449 additions and 56 deletions

View File

@@ -8,35 +8,68 @@ on:
branches: [master]
jobs:
build-windows:
runs-on: windows-latest
build-linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: master # pin to a specific version once stable
version: master
- name: Install LLVM 18
run: sudo apt-get update && sudo apt-get install -y llvm-18-dev
- name: Build
run: zig build -Dstatic-llvm -Dllvm-prefix=/usr/lib/llvm-18
- name: Test
run: zig build test -Dstatic-llvm -Dllvm-prefix=/usr/lib/llvm-18 --summary all
- name: Package
run: tar czf sx-linux-x86_64.tar.gz -C zig-out/bin .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sx-linux-x86_64
path: zig-out/bin/
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: sx-linux-x86_64.tar.gz
build-windows:
runs-on: windows-latest
env:
LLVM_PREFIX: C:\LLVM\llvm-18.1.8-windows-amd64-msvc17-msvcrt
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: master
- 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
shell: cmd
run: zig build -Dstatic-llvm -Dllvm-prefix=%LLVM_PREFIX% -Dtarget=x86_64-windows-msvc
- name: Test
shell: cmd
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
run: zig build test -Dstatic-llvm -Dllvm-prefix=%LLVM_PREFIX% -Dtarget=x86_64-windows-msvc --summary all
- name: Package
run: Compress-Archive -Path zig-out\bin\* -DestinationPath sx-windows-x86_64.zip