Skip to content

Commit d9bc645

Browse files
committed
Always build all versions by default
Updated notarize env variables
1 parent 8cfb6c1 commit d9bc645

File tree

4 files changed

+222
-225
lines changed

4 files changed

+222
-225
lines changed

resources/js/build/notarize.js

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
const { notarize } = require('@electron/notarize')
1+
const {notarize} = require('@electron/notarize')
22

33
module.exports = async (context) => {
4-
if (process.platform !== 'darwin') return
4+
if (process.platform !== 'darwin') return
55

6-
console.log('aftersign hook triggered, start to notarize app.')
6+
console.log('aftersign hook triggered, start to notarize app.')
77

8-
if (!process.env.CI) {
9-
console.log(`skipping notarizing, not in CI.`)
10-
return
11-
}
8+
if (!('NATIVEPHP_APPLE_ID' in process.env && 'NATIVEPHP_APPLE_ID_PASS' in process.env && 'NATIVEPHP_APPLE_TEAM_ID' in process.env)) {
9+
console.warn('skipping notarizing, NATIVEPHP_APPLE_ID, NATIVEPHP_APPLE_ID_PASS and NATIVEPHP_APPLE_TEAM_ID env variables must be set.')
10+
return
11+
}
1212

13-
if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
14-
console.warn('skipping notarizing, APPLE_ID and APPLE_ID_PASS env variables must be set.')
15-
return
16-
}
13+
const appId = process.env.NATIVEPHP_APP_ID;
1714

18-
const appId = process.env.NATIVEPHP_APP_ID;
15+
const {appOutDir} = context
1916

20-
const { appOutDir } = context
17+
const appName = context.packager.appInfo.productFilename
2118

22-
const appName = context.packager.appInfo.productFilename
19+
try {
20+
await notarize({
21+
appBundleId: appId,
22+
appPath: `${appOutDir}/${appName}.app`,
23+
appleId: process.env.NATIVEPHP_APPLE_ID,
24+
appleIdPassword: process.env.NATIVEPHP_APPLE_ID_PASS,
25+
teamId: process.env.NATIVEPHP_APPLE_TEAM_ID,
26+
tool: 'notarytool',
27+
})
28+
} catch (error) {
29+
console.error(error)
30+
}
2331

24-
try {
25-
await notarize({
26-
appBundleId: appId,
27-
appPath: `${appOutDir}/${appName}.app`,
28-
appleId: process.env.APPLE_ID,
29-
appleIdPassword: process.env.APPLE_ID_PASS
30-
})
31-
} catch (error) {
32-
console.error(error)
33-
}
34-
35-
console.log(`done notarizing ${appId}.`)
32+
console.log(`done notarizing ${appId}.`)
3633
}

resources/js/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"publish:mac-x86": "cross-env npm run build && cross-env electron-builder -p always --mac --config --x64 -p always",
1919
"publish:linux": "cross-env npm run publish:linux-x64",
2020
"publish:linux-x64": "cross-env npm run build && cross-env electron-builder --linux --config --x64 -p always",
21+
"build:all": "cross-env npm run build:mac && cross-env npm run build:win && cross-env npm run build:linux",
2122
"build:win": "cross-env node php.js --win && cross-env npm run build && cross-env electron-builder -p never --win --config",
2223
"build:mac": "cross-env npm run build:mac-arm && cross-env npm run build:mac-x86",
2324
"build:mac-arm": "cross-env node php.js --arm64 && cross-env npm run build && cross-env electron-builder -p never --mac --config --arm64",

0 commit comments

Comments
 (0)