mirror of https://github.com/keeweb/keeweb.git
Gracefully degrade if code signing config is not available
This commit is contained in:
parent
556fc31000
commit
6566fbe71c
40
Gruntfile.js
40
Gruntfile.js
|
@ -3,11 +3,21 @@
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const debug = require('debug');
|
const debug = require('debug');
|
||||||
|
const os = require('os');
|
||||||
|
|
||||||
const webpackConfig = require('./build/webpack.config');
|
const webpackConfig = require('./build/webpack.config');
|
||||||
const webpackConfigTest = require('./test/test.webpack.config');
|
const webpackConfigTest = require('./test/test.webpack.config');
|
||||||
const pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
const codeSignConfig = require('../keys/codesign');
|
|
||||||
|
let codeSignConfig;
|
||||||
|
if (os.platform() === 'darwin') {
|
||||||
|
try {
|
||||||
|
codeSignConfig = require('../keys/codesign');
|
||||||
|
} catch (err) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn('Code signing config missing - signing the macOS build will be skipped.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
debug.enable('electron-notarize');
|
debug.enable('electron-notarize');
|
||||||
|
|
||||||
|
@ -267,18 +277,22 @@ module.exports = function(grunt) {
|
||||||
appBundleId: 'net.antelle.keeweb',
|
appBundleId: 'net.antelle.keeweb',
|
||||||
appCategoryType: 'public.app-category.productivity',
|
appCategoryType: 'public.app-category.productivity',
|
||||||
extendInfo: 'package/osx/extend.plist',
|
extendInfo: 'package/osx/extend.plist',
|
||||||
osxSign: {
|
...(codeSignConfig
|
||||||
identity: codeSignConfig.identities.app,
|
? {
|
||||||
hardenedRuntime: true,
|
osxSign: {
|
||||||
entitlements: 'package/osx/entitlements.mac.plist',
|
identity: codeSignConfig.identities.app,
|
||||||
'entitlements-inherit': 'package/osx/entitlements.mac.plist',
|
hardenedRuntime: true,
|
||||||
'gatekeeper-assess': false
|
entitlements: 'package/osx/entitlements.mac.plist',
|
||||||
},
|
'entitlements-inherit': 'package/osx/entitlements.mac.plist',
|
||||||
osxNotarize: {
|
'gatekeeper-assess': false
|
||||||
appleId: codeSignConfig.appleId,
|
},
|
||||||
appleIdPassword: '@keychain:AC_PASSWORD',
|
osxNotarize: {
|
||||||
ascProvider: codeSignConfig.teamId
|
appleId: codeSignConfig.appleId,
|
||||||
},
|
appleIdPassword: '@keychain:AC_PASSWORD',
|
||||||
|
ascProvider: codeSignConfig.teamId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
afterCopy: [
|
afterCopy: [
|
||||||
(buildPath, electronVersion, platform, arch, callback) => {
|
(buildPath, electronVersion, platform, arch, callback) => {
|
||||||
if (path.basename(buildPath) !== 'app') {
|
if (path.basename(buildPath) !== 'app') {
|
||||||
|
|
Loading…
Reference in New Issue