@@ -149,7 +149,7 @@ jobs:
149
149
function getArches() {
150
150
switch (process.env.ARTIFACT_NAME) {
151
151
case "win":
152
- return ["x64"];
152
+ return ["x64" /*, "arm64" */ ]; // disabled arm64 for now as compilation doesn't work
153
153
case "linux":
154
154
return ["x64", "arm64", "armv7l", "ppc64le"];
155
155
case "mac":
@@ -159,32 +159,32 @@ jobs:
159
159
return ["x64"];
160
160
}
161
161
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);
163
163
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);
172
166
const arches = getArches();
173
167
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);
175
173
176
174
await $`mkdir -p llamaBins`;
177
175
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;
187
181
}
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}`;
188
188
}
189
189
190
190
await $`echo "Built binaries:"`;
0 commit comments