88
99jobs :
1010 build :
11- runs-on : ubuntu-latest
11+ strategy :
12+ matrix :
13+ include :
14+ - os : ubuntu-latest
15+ target : x86_64-linux
16+ - os : windows-latest
17+ target : x86_64-windows
18+ extra_flags : " "
19+ - os : macos-latest
20+ target : x86_64-macos
21+ - os : macos-latest
22+ target : aarch64-macos
23+ runs-on : ${{ matrix.os }}
1224 steps :
1325 - uses : actions/checkout@v4
1426
@@ -17,32 +29,17 @@ jobs:
1729 with :
1830 version : ' 0.14.0'
1931
20- - name : Build for x86_64-linux
32+ - name : Windows workaround
33+ if : matrix.os == 'windows-latest'
2134 run : |
22- zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux
23- mkdir -p artifacts
24- cp zig-out/bin/plscommit artifacts/plscommit-x86_64-linux
35+ Add-Content -Path build.zig -Value "`nexe.root_module.link_libc = true;" -Encoding utf8
2536
26- - name : Build for x86_64-windows
37+ - name : Build
2738 run : |
28- zig build -Doptimize=ReleaseFast -Dtarget=x86_64-windows
29- mkdir -p artifacts
30- cp zig-out/bin/plscommit artifacts/plscommit-x86_64-windows.exe
39+ zig build -Doptimize=ReleaseFast -Dtarget=${{ matrix.target }} ${{ matrix.extra_flags || '' }}
3140
32- - name : Build for x86_64-macos
33- run : |
34- zig build -Doptimize=ReleaseFast -Dtarget=x86_64-macos
35- mkdir -p artifacts
36- cp zig-out/bin/plscommit artifacts/plscommit-x86_64-macos
37-
38- - name : Build for aarch64-macos
39- run : |
40- zig build -Doptimize=ReleaseFast -Dtarget=aarch64-macos
41- mkdir -p artifacts
42- cp zig-out/bin/plscommit artifacts/plscommit-aarch64-macos
43-
44- - name : Upload artifacts
41+ - name : Upload artifact
4542 uses : actions/upload-artifact@v4
4643 with :
47- name : plscommit-binaries
48- path : artifacts/
44+ name : plscommit-${{ matrix.target }}
45+ path : zig-out/bin/plscommit
0 commit comments