From 5d982ea438716e5819220625f1cadf5b7d6a530a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 30 Apr 2025 11:29:20 +0300 Subject: [PATCH] chore(forge): gather files to be signed for analysis --- .github/workflows/nightly.yml | 7 +++++++ bin/electron-forge/sign-windows.cjs | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 83b9c436c..ecd3316d0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -77,6 +77,13 @@ jobs: tag_name: nightly name: Nightly Build + - name: Publish artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: signing ${{ matrix.os.name }} ${{ matrix.arch }} + path: build/bin/electron-forge/sign + - name: Publish artifacts uses: actions/upload-artifact@v4 if: ${{ github.event_name == 'pull_request' }} diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs index caa64dbc6..662fe5eef 100644 --- a/bin/electron-forge/sign-windows.cjs +++ b/bin/electron-forge/sign-windows.cjs @@ -1,5 +1,6 @@ const child_process = require("child_process"); const fs = require("fs"); +const { default: path } = require("path"); module.exports = function (filePath) { const { WINDOWS_SIGN_EXECUTABLE } = process.env; @@ -12,6 +13,14 @@ module.exports = function (filePath) { return; } + const outputDir = path.join(__dirname, "sign"); + console.log(path.resolve("Output dir is ", outputDir)); + if (!fs.existsSync(outputDir)) { + fs.mkdirSync(outputDir); + } + + fs.copyFileSync(sourcePath, destPath); + const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`; console.log(`[Sign] ${command}`);