perf(ci): stream release asset hashing instead of buffering into memory

Avoids holding every release binary in RAM at once when computing SHA256SUMS.txt.
This commit is contained in:
Andrew Fischer
2026-08-04 15:48:35 -07:00
parent 5da9525afd
commit e03407e684
+5 -2
View File
@@ -37,8 +37,11 @@ async function main(): Promise<void> {
const entries = await Promise.all(
assetPaths.map(async assetPath => {
const bytes = await Bun.file(assetPath).bytes();
return { name: path.basename(assetPath), sha256: Bun.SHA256.hash(bytes, "hex") };
const hasher = new Bun.CryptoHasher("sha256");
for await (const chunk of Bun.file(assetPath).stream()) {
hasher.update(chunk);
}
return { name: path.basename(assetPath), sha256: hasher.digest("hex") };
}),
);