From 03ae37ec2f074cf6ad7fe733f12255ff68c76606 Mon Sep 17 00:00:00 2001 From: Refringe Date: Tue, 5 Mar 2024 17:04:17 -0500 Subject: [PATCH] Hardcoded Build Platform and Architecture When the server was being built on systems other than Windows, that system's version of node was being downloaded for the build instead of the expected versions (Win/x64). This change hardcodes the values so that they're no longer dynamically pulled from the current system. Should help with generating automated builds. Also, re-enabled the build step that added the icon to the Windows executable. It was being skipped over on non-Windows platforms and I don't know why... it should be a cross-platform solution. --- project/gulpfile.mjs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/project/gulpfile.mjs b/project/gulpfile.mjs index 88a208a5..88b9f9da 100644 --- a/project/gulpfile.mjs +++ b/project/gulpfile.mjs @@ -7,9 +7,12 @@ import pkgfetch from "@yao-pkg/pkg-fetch"; import gulp from "gulp"; import { exec } from "gulp-execa"; import rename from "gulp-rename"; +// eslint-disable-next-line @typescript-eslint/naming-convention import * as ResEdit from "resedit"; import manifest from "./package.json" assert { type: "json" }; +const arch = "x64"; +const platform = "win32"; const nodeVersion = "node20"; // As of @yao-pkg/pkg-fetch v3.5.7, it's v20.10.0 const stdio = "inherit"; const buildDir = "build/"; @@ -36,9 +39,9 @@ const fetchPackageImage = async () => { const output = "./.pkg-cache/v3.5"; const fetchedPkg = await pkgfetch.need({ - arch: process.arch, + arch: arch, nodeRange: nodeVersion, - platform: process.platform, + platform: platform, output, }); console.log(`fetched node binary at ${fetchedPkg}`); @@ -56,7 +59,8 @@ const updateBuildProperties = async () => { if (os.platform() !== "win32") { - return; + console.debug("Attempting to update Windows executable properties on non-Windows platform."); + // Refringe was here. He's not sorry. } const exe = ResEdit.NtExecutable.from(await fs.readFile(serverExe)); @@ -279,7 +283,7 @@ const build = (packagingType) => // Packaging Arguments const packaging = async (entry) => { - const target = `${nodeVersion}-${process.platform}-${process.arch}`; + const target = `${nodeVersion}-${platform}-${arch}`; try { await pkg.exec([