mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 07:35:24 +00:00
fix: ship sharp binaries for Windows arm64 builds
This commit is contained in:
1 parent
da3f0c7836
commit
af87d09273
3 files changed
+30
-1
No files matched your search
@@ -115,7 +115,9 @@ jobs:
|
|||||||
Write-Host "Spectre libs present: $($found.FullName)"
|
Write-Host "Spectre libs present: $($found.FullName)"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: |
|
||||||
|
npm ci
|
||||||
|
node scripts/install-windows-sharp.cjs
|
||||||
|
|
||||||
# Bundled plugins are counted as downloads in the plugin store, so a
|
# Bundled plugins are counted as downloads in the plugin store, so a
|
||||||
# build only fetches them when the pins change.
|
# build only fetches them when the pins change.
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
- Linking the desktop app to a server no longer stalls on the server dashboard after sign in
|
- Linking the desktop app to a server no longer stalls on the server dashboard after sign in
|
||||||
- Exporting your data no longer fails when a plugin table has a text key, like saved passkeys
|
- Exporting your data no longer fails when a plugin table has a text key, like saved passkeys
|
||||||
|
- The Windows on ARM desktop app starts again instead of failing with a local server error
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
const fs = require("node:fs");
|
||||||
|
const path = require("node:path");
|
||||||
|
const { execFileSync } = require("node:child_process");
|
||||||
|
|
||||||
|
function findPackage(start) {
|
||||||
|
let directory = path.dirname(start);
|
||||||
|
while (directory !== path.dirname(directory)) {
|
||||||
|
const manifest = path.join(directory, "package.json");
|
||||||
|
if (fs.existsSync(manifest)) return JSON.parse(fs.readFileSync(manifest));
|
||||||
|
directory = path.dirname(directory);
|
||||||
|
}
|
||||||
|
throw new Error("Could not locate the installed sharp package manifest");
|
||||||
|
}
|
||||||
|
|
||||||
|
// The build runs on x64 but ships arm64 and ia32 too, so npm ci alone
|
||||||
|
// only installs the x64 binary.
|
||||||
|
const sharpPackage = findPackage(require.resolve("sharp"));
|
||||||
|
const packages = [
|
||||||
|
"@img/sharp-win32-arm64",
|
||||||
|
"@img/sharp-win32-ia32",
|
||||||
|
"@img/sharp-win32-x64",
|
||||||
|
].map((name) => `${name}@${sharpPackage.optionalDependencies[name]}`);
|
||||||
|
|
||||||
|
execFileSync("npm.cmd", ["install", "--force", "--no-save", ...packages], {
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
Reference in new issue
Block a user