@@ -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,6 +134,28 @@ jobs:
126134 gh release upload "v${{ needs.prepare.outputs.version }}" \
127135 dist/*.tar.gz dist/*.sha256 --clobber
128136
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)
140+ if : matrix.os == 'ubuntu-latest'
141+ env :
142+ RAY_VERSION : ${{ needs.prepare.outputs.version }}
143+ run : |
144+ set -euo pipefail
145+ ver="$(curl -fsSL https://api.github.com/repos/goreleaser/nfpm/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')"
146+ curl -fsSL "https://github.com/goreleaser/nfpm/releases/download/${ver}/nfpm_${ver#v}_amd64.deb" -o /tmp/nfpm.deb
147+ sudo dpkg -i /tmp/nfpm.deb
148+ mkdir -p dist
149+ nfpm pkg --packager deb --config packaging/nfpm.yaml --target dist/
150+ ls -l dist/*.deb
151+
152+ - name : Upload .deb to release (Linux)
153+ if : matrix.os == 'ubuntu-latest'
154+ env :
155+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156+ GH_REPO : ${{ github.repository }}
157+ run : gh release upload "v${{ needs.prepare.outputs.version }}" dist/*.deb --clobber
158+
129159 publish :
130160 needs : [prepare, build]
131161 runs-on : ubuntu-latest
@@ -169,3 +199,40 @@ jobs:
169199 --data-urlencode "content=${content}")"
170200 echo "Zulip response: $resp"
171201 echo "$resp" | grep -q '"result": *"success"'
202+
203+ # Bump the Homebrew tap (RayforceDB/homebrew-tap → Formula/rayforce.rb) to this
204+ # release. Best-effort: skipped when HOMEBREW_TAP_TOKEN isn't configured, and
205+ # continue-on-error so a tap hiccup never reds an already-shipped release.
206+ homebrew :
207+ needs : [prepare, publish]
208+ runs-on : ubuntu-latest
209+ env :
210+ HOMEBREW_TAP_TOKEN : ${{ secrets.HOMEBREW_TAP_TOKEN }}
211+ steps :
212+ - uses : actions/checkout@v5
213+ with :
214+ ref : ${{ needs.prepare.outputs.sha }}
215+ - name : Update tap formula
216+ if : ${{ env.HOMEBREW_TAP_TOKEN != '' }}
217+ continue-on-error : true
218+ env :
219+ VERSION : ${{ needs.prepare.outputs.version }}
220+ GH_REPO : ${{ github.repository }}
221+ TAP_REPO : RayforceDB/homebrew-tap
222+ run : |
223+ set -euo pipefail
224+ # Build-from-source formula: point at the GitHub source tarball for the
225+ # tag and pin its sha256.
226+ url="https://github.com/${GH_REPO}/archive/refs/tags/v${VERSION}.tar.gz"
227+ sha="$(curl -fsSL "$url" | sha256sum | cut -d' ' -f1)"
228+ tmp="$(mktemp -d)"
229+ git clone --depth 1 "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/${TAP_REPO}.git" "$tmp"
230+ mkdir -p "$tmp/Formula"
231+ sed -e "s|__URL__|${url}|" -e "s|__SHA256__|${sha}|" \
232+ packaging/homebrew-formula.rb.tmpl > "$tmp/Formula/rayforce.rb"
233+ cd "$tmp"
234+ git config user.name "rayforce-release"
235+ git config user.email "release@rayforcedb.com"
236+ git add Formula/rayforce.rb
237+ git commit -m "rayforce ${VERSION}" || { echo "formula unchanged — nothing to push"; exit 0; }
238+ git push origin HEAD
0 commit comments