@@ -101,9 +101,17 @@ jobs:
101101 strategy :
102102 fail-fast : false
103103 matrix :
104+ # Distributables must be PORTABLE, not -march=native: a native binary
105+ # built on a runner can SIGILL on a different/older CPU. x86-64-v3 =
106+ # AVX2 baseline (~2013+), which keeps the engine's vectorized reductions
107+ # fast. The macOS runner is the oldest Apple-Silicon class, so native
108+ # there is effectively a safe floor (arm64 has no x86-style optional-ISA
109+ # traps, and baselining to armv8-a would only lose M1 tuning).
104110 include :
105111 - os : ubuntu-latest
112+ march : x86-64-v3
106113 - os : macos-latest
114+ march : native
107115 # Windows is not build-ready yet (IOCP stub, unguarded POSIX in
108116 # main.c/heap.c, no Makefile path). Add once the port lands:
109117 # - os: windows-latest
@@ -114,8 +122,8 @@ jobs:
114122 with :
115123 ref : ${{ needs.prepare.outputs.sha }}
116124
117- - name : Build release artifact
118- run : make dist RAY_VERSION=${{ needs.prepare.outputs.version }}
125+ - name : Build release artifact (portable)
126+ run : make dist RAY_VERSION=${{ needs.prepare.outputs.version }} RAY_MARCH=${{ matrix.march }}
119127
120128 - name : Upload artifacts to release
121129 env :
@@ -126,18 +134,14 @@ jobs:
126134 gh release upload "v${{ needs.prepare.outputs.version }}" \
127135 dist/*.tar.gz dist/*.sha256 --clobber
128136
129- # The tarball above is -march=native (built for THIS runner's CPU). For a
130- # redistributable .deb we rebuild a PORTABLE binary (x86-64-v3 = AVX2,
131- # ~2013+) so it can't SIGILL on a different/older CPU; `make clean` first
132- # so the native .o files aren't reused.
133- - name : Build portable .deb (Linux)
137+ # Package the just-built (already-portable) Linux binary as a .deb —
138+ # `make dist` left ./rayforce in place, so no rebuild is needed.
139+ - name : Build .deb (Linux)
134140 if : matrix.os == 'ubuntu-latest'
135141 env :
136142 RAY_VERSION : ${{ needs.prepare.outputs.version }}
137143 run : |
138144 set -euo pipefail
139- make clean
140- make release RAY_VERSION="$RAY_VERSION" RAY_MARCH=x86-64-v3
141145 ver="$(curl -fsSL https://api.github.com/repos/goreleaser/nfpm/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')"
142146 curl -fsSL "https://github.com/goreleaser/nfpm/releases/download/${ver}/nfpm_${ver#v}_amd64.deb" -o /tmp/nfpm.deb
143147 sudo dpkg -i /tmp/nfpm.deb
0 commit comments