@@ -59,19 +59,17 @@ jobs:
5959 matrix :
6060 include :
6161 # Each target builds ONE binary in parallel (~5 min each)
62- # Index matches allTargets array in build.ts
62+ # Index matches allTargets array in build.ts. Targets without a
63+ # @altimateai/altimate-core NAPI prebuild (linux-*-musl, win32-arm64)
64+ # are intentionally excluded — see allTargets in build.ts.
6365 - { index: 0, name: "linux-arm64" }
6466 - { index: 1, name: "linux-x64" }
6567 - { index: 2, name: "linux-x64-baseline" }
66- - { index: 3, name: "linux-arm64-musl" }
67- - { index: 4, name: "linux-x64-musl" }
68- - { index: 5, name: "linux-x64-baseline-musl" }
69- - { index: 6, name: "darwin-arm64" }
70- - { index: 7, name: "darwin-x64" }
71- - { index: 8, name: "darwin-x64-baseline" }
72- - { index: 9, name: "win32-arm64" }
73- - { index: 10, name: "win32-x64" }
74- - { index: 11, name: "win32-x64-baseline" }
68+ - { index: 3, name: "darwin-arm64" }
69+ - { index: 4, name: "darwin-x64" }
70+ - { index: 5, name: "darwin-x64-baseline" }
71+ - { index: 6, name: "win32-x64" }
72+ - { index: 7, name: "win32-x64-baseline" }
7573 steps :
7674 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
7775
@@ -106,17 +104,22 @@ jobs:
106104 - name : Smoke test binary
107105 if : matrix.name == 'linux-x64'
108106 run : |
109- BINARY=$(find packages/opencode/dist -name altimate -type f | head -1)
107+ # Resolve to an absolute path before we cd away from the workspace.
108+ BINARY=$(find "$(pwd)/packages/opencode/dist" -name altimate -type f | head -1)
110109 if [ -z "$BINARY" ]; then
111110 echo "::error::No binary found in dist/"
112111 exit 1
113112 fi
114113 chmod +x "$BINARY"
115114
116- # Set NODE_PATH so the binary can resolve external NAPI modules
117- # (mirrors what the npm bin wrapper does at runtime)
118- NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
119- echo "Smoke test passed: binary starts and prints version"
115+ # Run with NO pre-set NODE_PATH AND from a directory with no
116+ # node_modules anywhere upward. Bun's compiled binary would
117+ # otherwise walk the workspace tree for node_modules and resolve
118+ # altimate-core that way — the test would pass for the wrong
119+ # reason if the staged shim ever silently misses.
120+ cd "${RUNNER_TEMP:-/tmp}"
121+ env -u NODE_PATH "$BINARY" --version
122+ echo "Smoke test passed: standalone binary starts hermetically"
120123
121124 - name : Upload build artifact
122125 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -256,13 +259,18 @@ jobs:
256259 # compile-time checks miss (e.g. missing NAPI externals like v0.5.10).
257260 - name : Pre-publish smoke test
258261 run : |
259- BINARY=$(find packages/opencode/dist -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
262+ # Resolve to an absolute path before we cd away from the workspace.
263+ BINARY=$(find "$(pwd)/packages/opencode/dist" -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
260264 if [ -z "$BINARY" ]; then
261265 echo "::error::No linux-x64 binary found in artifacts — cannot verify release"
262266 exit 1
263267 else
264268 chmod +x "$BINARY"
265- NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
269+ # No NODE_PATH AND hermetic cwd: see the build-time smoke test
270+ # comment for why this matters. The binary must start without
271+ # walking the workspace for node_modules.
272+ cd "${RUNNER_TEMP:-/tmp}"
273+ env -u NODE_PATH "$BINARY" --version
266274 echo "Pre-publish smoke test passed"
267275 fi
268276
@@ -349,6 +357,13 @@ jobs:
349357 path : packages/opencode/dist/
350358 merge-multiple : true
351359
360+ - name : Generate checksums
361+ # Single checksums.txt (sha256sum format: "<hash> <bare-filename>") shipped
362+ # as a release asset. The curl and PowerShell installers fetch it and verify
363+ # the downloaded archive before extracting.
364+ working-directory : packages/opencode/dist
365+ run : sha256sum *.tar.gz *.zip > checksums.txt
366+
352367 - name : Create GitHub Release
353368 uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
354369 with :
@@ -358,5 +373,6 @@ jobs:
358373 files : |
359374 packages/opencode/dist/*.tar.gz
360375 packages/opencode/dist/*.zip
376+ packages/opencode/dist/checksums.txt
361377 env :
362378 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments