Skip to content

Commit 45b02fd

Browse files
JoeCowlesclaude
andcommitted
feat: add macOS notarization to electron-builder pipeline
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b18511e commit 45b02fd

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/electron-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ jobs:
9191
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9292
CSC_LINK: ${{ secrets.MAC_CERT_P12_BASE64 }}
9393
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }}
94+
APPLE_ID: ${{ secrets.APPLE_ID }}
95+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
96+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
9497

9598
- name: Build installer — local artifact only
9699
if: "!startsWith(github.ref, 'refs/tags/') && inputs.publish != 'true'"
@@ -99,6 +102,9 @@ jobs:
99102
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100103
CSC_LINK: ${{ secrets.MAC_CERT_P12_BASE64 }}
101104
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }}
105+
APPLE_ID: ${{ secrets.APPLE_ID }}
106+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
107+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
102108

103109
# ── Upload build artifacts ─────────────────────────────────────────────
104110
- name: Upload installer artifact

electron-builder.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
appId: 'com.podcommentators.app',
77
productName: 'Podcommentators',
88
copyright: 'Copyright © 2025 Podcommentators',
9+
afterSign: 'electron/notarize.js',
910

1011
// Where electron-builder looks for the compiled main process JS
1112
directories: {

electron/notarize.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { notarize } = require('@electron/notarize');
2+
3+
exports.default = async function notarizing(context) {
4+
const { electronPlatformName, appOutDir } = context;
5+
if (electronPlatformName !== 'darwin') return;
6+
7+
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD || !process.env.APPLE_TEAM_ID) {
8+
console.log('Skipping notarization — APPLE_ID, APPLE_ID_PASSWORD, or APPLE_TEAM_ID not set');
9+
return;
10+
}
11+
12+
const appName = context.packager.appInfo.productFilename;
13+
14+
console.log(`Notarizing ${appName}...`);
15+
16+
await notarize({
17+
appBundleId: 'com.podcommentators.app',
18+
appPath: `${appOutDir}/${appName}.app`,
19+
appleId: process.env.APPLE_ID,
20+
appleIdPassword: process.env.APPLE_ID_PASSWORD,
21+
teamId: process.env.APPLE_TEAM_ID,
22+
});
23+
24+
console.log('Notarization complete');
25+
};

0 commit comments

Comments
 (0)