Skip to content

Commit

Permalink
Merge pull request #5485 from brave/issue_5177
Browse files Browse the repository at this point in the history
Add MacOS notarization
  • Loading branch information
mihaiplesa authored Oct 30, 2019
2 parents 64bfc6c + 5c49038 commit fb78a11
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/lib/config.js
Original file line number Diff line number Diff line change
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 build/lib/createDist.js
Original file line number Diff line number Diff line change
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 build/scripts/commands.js
Original file line number Diff line number Diff line change
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 fb78a11

Please sign in to comment.