wip: ci tests

This commit is contained in:
Edwin Joassart 2023-04-18 18:14:21 +02:00
parent 81910d27ee
commit b5042e9b9f

View File

@ -8,18 +8,16 @@ const builder = require("electron-builder");
const { flipFuses, FuseVersion, FuseV1Options } = require("@electron/fuses"); const { flipFuses, FuseVersion, FuseV1Options } = require("@electron/fuses");
exports.default = async function (context) { exports.default = async function (context) {
if (context.packager.platform.name !== "linux") { if (context.packager.platform.name === "linux") {
return; const scriptPath = path.join(
} context.appOutDir,
const scriptPath = path.join( context.packager.executableName
context.appOutDir, );
context.packager.executableName const binPath = scriptPath + ".bin";
); cp.execFileSync("mv", [scriptPath, binPath]);
const binPath = scriptPath + ".bin"; fs.writeFileSync(
cp.execFileSync("mv", [scriptPath, binPath]); scriptPath,
fs.writeFileSync( outdent({ trimTrailingNewline: false })`
scriptPath,
outdent({ trimTrailingNewline: false })`
#!/bin/bash #!/bin/bash
# Resolve symlinks. Warning, readlink -f doesn't work on MacOS/BSD # Resolve symlinks. Warning, readlink -f doesn't work on MacOS/BSD
@ -31,8 +29,9 @@ exports.default = async function (context) {
"\${script_dir}"/${context.packager.executableName}.bin "$@" --no-sandbox "\${script_dir}"/${context.packager.executableName}.bin "$@" --no-sandbox
fi fi
` `
); );
cp.execFileSync("chmod", ["+x", scriptPath]); cp.execFileSync("chmod", ["+x", scriptPath]);
}
// Adapted from https://github.com/electron-userland/electron-builder/issues/6365#issue-1033809141 // Adapted from https://github.com/electron-userland/electron-builder/issues/6365#issue-1033809141
const ext = { const ext = {
@ -65,6 +64,6 @@ exports.default = async function (context) {
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false, [FuseV1Options.EnableNodeCliInspectArguments]: false,
// [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, // Only affects macOS builds, but breaks them -- https://github.com/electron/fuses/issues/7 // [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, // Only affects macOS builds, but breaks them -- https://github.com/electron/fuses/issues/7
[FuseV1Options.OnlyLoadAppFromAsar]: true, [FuseV1Options.OnlyLoadAppFromAsar]: false,
}); });
}; };