@@ -149,7 +149,7 @@ jobs:
149149 function getArches() {
150150 switch (process.env.ARTIFACT_NAME) {
151151 case "win":
152- return ["x64"];
152+ return ["x64" /*, "arm64" */ ]; // disabled arm64 for now as compilation doesn't work
153153 case "linux":
154154 return ["x64", "arm64", "armv7l", "ppc64le"];
155155 case "mac":
@@ -159,32 +159,32 @@ jobs:
159159 return ["x64"];
160160 }
161161
162- const {versions: latestNodeVersions, latestVersion: latestNodeVersion } = await getLatestNodeVersions(Date.now() - 1000 * 60 * 60 * 24 * 14);
162+ const {versions: latestNodeVersions} = await getLatestNodeVersions(Date.now() - 1000 * 60 * 60 * 24 * 14);
163163
164- const minNodeVersion = latestNodeVersion - 4;
165-
166- const nodeVersions = [...latestNodeVersions].reduce((acc, [majorVersion, version]) => {
167- if (majorVersion >= minNodeVersion)
168- acc.push(version);
169-
170- return acc;
171- }, []);
164+ const nodeVersion = latestNodeVersions.get(18);
165+ const windowsOnArmNodeVersion = latestNodeVersions.get(20);
172166 const arches = getArches();
173167
174- console.log("Building for node versions", nodeVersions, "and archs", arches);
168+ if (nodeVersion == null || windowsOnArmNodeVersion == null) {
169+ throw new Error("Could not find node versions");
170+ }
171+
172+ console.log("Building for node version", nodeVersion, "and archs", arches);
175173
176174 await $`mkdir -p llamaBins`;
177175
178- for (const nodeVersion of nodeVersions) {
179- for (const arch of arches) {
180- console.log(`Building ${arch} for node ${nodeVersion}`);
181-
182- const majorNodeVersion = parseInt(nodeVersion.slice("v".length))
183-
184- const binName = `${process.env.ARTIFACT_NAME}-${arch}-${majorNodeVersion}`;
185- await $`node ./dist/cli/cli.js build --arch ${arch} --nodeTarget ${nodeVersion}`;
186- await $`mv ./llama/build/Release ${"./llamaBins/" + binName}`;
176+ for (const arch of arches) {
177+ let buildNodeVersion = nodeVersion;
178+
179+ if (process.env.ARTIFACT_NAME === "win" && arch === "arm64") {
180+ buildNodeVersion = windowsOnArmNodeVersion;
187181 }
182+
183+ console.log(`Building ${arch} for node ${buildNodeVersion}`);
184+
185+ const binName = `${process.env.ARTIFACT_NAME}-${arch}`;
186+ await $`node ./dist/cli/cli.js build --arch ${arch} --nodeTarget ${buildNodeVersion}`;
187+ await $`mv ./llama/build/Release ${"./llamaBins/" + binName}`;
188188 }
189189
190190 await $`echo "Built binaries:"`;
0 commit comments