From 40f4fdab4761d25f89034f23b64d099a7d539e2e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:22:22 +0200 Subject: [PATCH] feat(ci): set up signing hook --- bin/copy-dist.ts | 1 + bin/electron-forge/sign-windows.cjs | 8 ++++++++ forge.config.cjs | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 bin/electron-forge/sign-windows.cjs diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 4e4808137..eaa79808e 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -34,6 +34,7 @@ try { "./forge.config.cjs", "./bin/tpl/", "./bin/electron-forge/desktop.ejs", + "./bin/electron-forge/sign-windows.cjs", "./src/views/", "./src/etapi/etapi.openapi.yaml", "./src/routes/api/openapi.json", diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs new file mode 100644 index 000000000..446a6279e --- /dev/null +++ b/bin/electron-forge/sign-windows.cjs @@ -0,0 +1,8 @@ +const child_process = require("child_process"); +const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; + +module.exports = function (filePath) { + const command = `${SIGN_EXECUTABLE} --executable "${filePath}"`; + console.log(`> ${command}`); + child_process.execSync(command); +} \ No newline at end of file diff --git a/forge.config.cjs b/forge.config.cjs index 463a6a19f..288826f8a 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -26,6 +26,9 @@ module.exports = { appleIdPassword: process.env.APPLE_ID_PASSWORD, teamId: process.env.APPLE_TEAM_ID }, + windowsSign: { + hookModulePath: "bin\\sign-windows.cjs" + }, extraResource: [ // All resources should stay in Resources directory for macOS ...(process.platform === "darwin" ? [] : extraResourcesForPlatform),