Skip to content

Build your personal knowledge base with Trilium Notes

feat(signing): use environment variables for the executable path

Elian Doran34043a8a7020
diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml
index 5a4aa11a20..4f8f0bea2e 100644
--- a/.github/actions/build-electron/action.yml
+++ b/.github/actions/build-electron/action.yml
@@ -79,6 +79,7 @@ runs:
APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }}
APPLE_ID: ${{ env.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
+ WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
run: |
npm run electron-forge:make -- \
--arch=${{ inputs.arch }} \
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index cf8b894e80..1b947391f6 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -50,6 +50,7 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
+ WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }}
- name: Publish release
uses: softprops/action-gh-release@v2
diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs
index 0862cdfaa7..527a27dc68 100644
--- a/bin/electron-forge/sign-windows.cjs
+++ b/bin/electron-forge/sign-windows.cjs
@@ -1,8 +1,14 @@
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}"`;
+ const { WINDOWS_SIGN_EXECUTABLE } = process.env;
+
+ if (!WINDOWS_SIGN_EXECUTABLE) {
+ console.warn("[Sign] Skip signing due to missing environment variable.");
+ return;
+ }
+
+ const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`;
console.log(`[Sign] ${command}`);
child_process.execSync(command);
}
\ No newline at end of file