Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Commit d04a808

Browse files
authored
Merge pull request #24 from gwleuverink/enhancement/osx-build-codesigning
Automate code signing & notarization
2 parents c49b64a + fcd2eeb commit d04a808

6 files changed

Lines changed: 114 additions & 12 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-jit</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8+
<true/>
9+
<key>com.apple.security.network.client</key>
10+
<true/>
11+
</dict>
12+
</plist>

env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Apple env vars used for code signing locally. Will be injected by CI on automated builds
2+
APPLE_ID=
3+
APPLE_ID_PASSWORD=
4+
5+
VUE_APP_SENTRY_DSN=

notarize.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// "afterSign": "./afterSignHook.js",
2+
3+
require('dotenv').config();
4+
const fs = require('fs');
5+
const path = require('path');
6+
var electron_notarize = require('electron-notarize');
7+
8+
module.exports = async function (params) {
9+
if (process.platform !== 'darwin') {
10+
return;
11+
}
12+
13+
console.log('afterSign hook triggered', params);
14+
15+
let appId = 'nl.gwleuverink.clickup-time-tracker'
16+
17+
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
18+
if (!fs.existsSync(appPath)) {
19+
console.log('skip');
20+
return;
21+
}
22+
23+
console.log(`Notarizing ${appId} found at ${appPath}`);
24+
25+
try {
26+
await electron_notarize.notarize({
27+
appBundleId: appId,
28+
appPath: appPath,
29+
appleId: process.env.APPLE_ID,
30+
appleIdPassword: process.env.APPLE_ID_PASSWORD,
31+
});
32+
} catch (error) {
33+
console.error(error);
34+
}
35+
36+
console.log(`Done notarizing ${appId}`);
37+
};

package-lock.json

Lines changed: 49 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "0.2.0",
3+
"version": "1.0.0",
44
"name": "clickup-time-tracker",
55
"productName": "Time Tracker",
66
"description": "A tool for painlessly tracking time on Clickup tasks",
@@ -24,6 +24,7 @@
2424
"postinstall": "electron-builder install-app-deps",
2525
"postuninstall": "electron-builder install-app-deps"
2626
},
27+
"main": "background.js",
2728
"dependencies": {
2829
"@heroicons/vue": "^1.0.5",
2930
"@sentry/electron": "^3.0.7",
@@ -45,8 +46,10 @@
4546
"@vue/compiler-sfc": "^3.0.0",
4647
"autoprefixer": "^10.4.7",
4748
"babel-eslint": "^10.1.0",
49+
"dotenv": "^16.0.1",
4850
"electron": "^18.0.0",
4951
"electron-devtools-installer": "^3.2.0",
52+
"electron-notarize": "^1.2.1",
5053
"eslint": "^7.5.0",
5154
"eslint-plugin-vue": "^9.1.1",
5255
"postcss": "^8.4.14",

vue.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ module.exports = {
66
electronBuilder: {
77
nodeIntegration: true,
88
preload: 'src/preload.js',
9-
productName: 'Time Tracker',
9+
productName: 'ClickUp Time Tracker',
1010
artifactName: 'time-tracker-${version}-${os}-${arch}.${ext}',
1111
builderOptions: {
1212
publish: [
1313
{ provider: 'github', private: false, releaseType: 'release' },
1414
],
1515

1616
mac: {
17+
target: [ "dmg" ],
1718
hardenedRuntime: true,
1819
category: "public.app-category.productivity",
19-
target: [ "dmg" ],
20+
entitlements: "./build/entitlements.mac.inherit.plist",
21+
entitlementsInherit: "./build/entitlements.mac.inherit.plist",
2022
},
2123

2224
linux: {
2325
target: ["AppImage"],
2426
executableName: 'Time Tracker',
2527
},
28+
29+
appId: 'nl.gwleuverink.clickup-time-tracker',
30+
afterSign: './notarize.js'
2631
}
2732
}
2833
},

0 commit comments

Comments
 (0)