Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[ensu] fixes to windows signing (#9488)

Prateek5a63785bb982
diff --git a/.github/workflows/ensu-release.yml b/.github/workflows/ensu-release.yml
index 0fe2e5dc06..a4383ad291 100644
--- a/.github/workflows/ensu-release.yml
+++ b/.github/workflows/ensu-release.yml
@@ -107,6 +107,13 @@ jobs:
shell: bash
run: cargo install --locked trusted-signing-cli
+ - name: Add cargo bin to PATH (Windows only)
+ if: matrix.platform.os == 'windows-latest' && env.HAS_WINDOWS_SIGNING == 'true'
+ shell: bash
+ run: |
+ CARGO_BIN_WIN=$(cygpath -w "$HOME/.cargo/bin")
+ echo "$CARGO_BIN_WIN" >> $GITHUB_PATH
+
- name: Resolve Windows signing tool paths
if: matrix.platform.os == 'windows-latest' && env.HAS_WINDOWS_SIGNING == 'true'
shell: bash
@@ -142,13 +149,10 @@ jobs:
echo "TRUSTED_SIGNING_CLI_PATH=$TRUSTED_SIGNING_CLI_PATH" >> $GITHUB_ENV
if [ -n "$AZ_PATH" ]; then
echo "AZURE_CLI_PATH=$AZ_PATH" >> $GITHUB_ENV
- echo "Resolved AZURE_CLI_PATH=$AZ_PATH"
fi
if [ -n "$SIGNTOOL_PATH" ]; then
echo "SIGNTOOL_PATH=$SIGNTOOL_PATH" >> $GITHUB_ENV
- echo "Resolved SIGNTOOL_PATH=$SIGNTOOL_PATH"
fi
- echo "Resolved TRUSTED_SIGNING_CLI_PATH=$TRUSTED_SIGNING_CLI_PATH"
- name: Enable Windows signCommand for Tauri (Azure Trusted Signing)
if: matrix.platform.os == 'windows-latest' && env.HAS_WINDOWS_SIGNING == 'true'
diff --git a/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs b/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
index a702080dbd..7e689c24c5 100644
--- a/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
+++ b/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
@@ -7,6 +7,7 @@ const configPath =
const endpoint = process.env.AZURE_ENDPOINT;
const accountName = process.env.AZURE_CODE_SIGNING_NAME;
const profileName = process.env.AZURE_CERT_PROFILE_NAME;
+const trustedSigningCliPath = process.env.TRUSTED_SIGNING_CLI_PATH?.trim();
if (!endpoint || !accountName || !profileName) {
throw new Error(
@@ -18,7 +19,21 @@ const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
config.bundle = config.bundle || {};
config.bundle.windows = config.bundle.windows || {};
-config.bundle.windows.signCommand = `trusted-signing-cli -v -e ${endpoint} -a ${accountName} -c ${profileName} -d Ensu "%1"`;
+const signerBinary = trustedSigningCliPath || "trusted-signing-cli";
+config.bundle.windows.signCommand = {
+ cmd: signerBinary,
+ args: [
+ "-e",
+ endpoint,
+ "-a",
+ accountName,
+ "-c",
+ profileName,
+ "-d",
+ "Ensu",
+ "%1",
+ ],
+};
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
console.log(`Updated windows signCommand in ${configPath}`);