Skip to content

Commit 4899b43

Browse files
authored
FIX: github workflow macos build (#2301)
* FIX: macos build * FIX: format * FIX: workflow build
1 parent 13daa72 commit 4899b43

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

launcher/afterSignMac.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const { execSync } = require("child_process");
2+
const path = require("path");
3+
4+
// electron-builder v26 no longer re-signs bundled frameworks when no certificate is
5+
// provided. The Electron Framework ships pre-signed with the Electron project's Apple
6+
// Team ID, causing macOS 26+ to reject the load because the main executable has no
7+
// Team ID. Re-sign everything with ad-hoc ("-") so all binaries share a consistent
8+
// (empty) Team ID and dyld's validation passes.
9+
//
10+
// This must be afterSign (not afterPack) for --universal builds: afterPack fires once
11+
// per arch on the temporary per-arch outputs before @electron/universal merges them.
12+
// Re-signing those temps makes CodeResources differ between architectures, causing the
13+
// merge to fail with "non-binary files have different SHAs". afterSign fires once on
14+
// the final merged universal .app, after the merge succeeds.
15+
exports.default = async function afterSignMac(context) {
16+
if (context.electronPlatformName !== "darwin") return;
17+
18+
const appPath = path.join(context.appOutDir, `${context.packager.appInfo.productFilename}.app`);
19+
20+
console.log(`[afterSignMac] Ad-hoc re-signing for macOS 26+ Team ID compatibility:`);
21+
console.log(`[afterSignMac] ${appPath}`);
22+
23+
execSync(`codesign --force --deep --sign - "${appPath}"`, { stdio: "inherit" });
24+
25+
console.log(`[afterSignMac] Done.`);
26+
};

launcher/vue.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ module.exports = {
1212
},
1313
appId: "com.stereum.launcher",
1414
productName: "Stereum-Launcher",
15-
...(shouldNotarize ? { afterSign: "@sapien99/vue-cli-plugin-electron-builder-notarize" } : {}),
16-
...(!isSigned ? { afterPack: "./afterPackMac.js" } : {}),
15+
...(shouldNotarize
16+
? { afterSign: "@sapien99/vue-cli-plugin-electron-builder-notarize" }
17+
: !isSigned
18+
? { afterSign: "./afterSignMac.js" }
19+
: {}),
1720
buildDependenciesFromSource: false,
1821
nodeGypRebuild: false,
1922
npmRebuild: false,

0 commit comments

Comments
 (0)