Skip to content

Commit

Permalink
Add MacOS notarization
Browse files Browse the repository at this point in the history
Fixes: brave#5177
  • Loading branch information
mbacchi authored and notjuanortiz committed Nov 1, 2019
1 parent 079c09f commit 5d0715e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/config.js
Expand Up @@ -66,6 +66,8 @@ const Config = function () {
this.mac_installer_signing_identifier = getNPMConfig(['mac_installer_signing_identifier']) || ''
this.mac_signing_keychain = getNPMConfig(['mac_signing_keychain']) || 'login'
this.mac_signing_output_prefix = 'signing'
this.notary_user = getNPMConfig(['notary_user']) || ''
this.notary_password = getNPMConfig(['notary_password']) || ''
this.channel = ''
this.sccache = getNPMConfig(['sccache'])
this.braveReferralsApiKey = getNPMConfig(['brave_referrals_api_key']) || ''
Expand Down Expand Up @@ -134,6 +136,11 @@ Config.prototype.buildArgs = function () {
args.mac_installer_signing_identifier = this.mac_installer_signing_identifier
args.mac_signing_keychain = this.mac_signing_keychain
args.mac_signing_output_prefix = this.mac_signing_output_prefix
if (this.notarize) {
args.notarize = true
args.notary_user = this.notary_user
args.notary_password = this.notary_password
}
}

if (process.platform === 'win32' && this.build_omaha) {
Expand Down Expand Up @@ -434,6 +441,9 @@ Config.prototype.update = function (options) {
if (options.mac_signing_keychain)
this.mac_signing_keychain = options.mac_signing_keychain

if (options.notarize)
this.notarize = true

if (options.gclient_verbose)
this.gClientVerbose = options.gclient_verbose

Expand Down
6 changes: 6 additions & 0 deletions lib/createDist.js
Expand Up @@ -7,6 +7,12 @@ const createDist = (buildConfig = config.defaultBuildConfig, options) => {
config.buildConfig = buildConfig
config.update(options)

if (config.notarize) {
notarize = config.notarize
notary_user = config.notary_user
notary_password = config.notary_password
}

util.updateBranding()
fs.removeSync(path.join(config.outputDir, 'dist'))
config.buildTarget = 'create_dist'
Expand Down
1 change: 1 addition & 0 deletions scripts/commands.js
Expand Up @@ -73,6 +73,7 @@ program
.option('--tag_ap <ap>', 'ap for stub/standalone installer')
.option('--skip_signing', 'skip signing dmg/brave_installer.exe')
.option('--brave_safetynet_api_key <brave_safetynet_api_key>')
.option('--notarize', 'notarize the macOS app with Apple')
.arguments('[build_config]')
.action(createDist)

Expand Down

0 comments on commit 5d0715e

Please sign in to comment.