Skip to content

Commit

Permalink
Merge pull request #6736 from brave/pr3725_issue_5177_0.72.x
Browse files Browse the repository at this point in the history
Add MacOS notarization (Uplift of #5485 to 0.72.x)
  • Loading branch information
bsclifton committed Nov 4, 2019
2 parents 7cfc230 + a15c007 commit c3508d7
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 @@ -64,6 +64,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 @@ -129,6 +131,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 @@ -426,6 +433,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 @@ -71,6 +71,7 @@ program
.option('--build_omaha', 'build omaha stub/standalone installer')
.option('--tag_ap <ap>', 'ap for stub/standalone installer')
.option('--skip_signing', 'skip signing dmg/brave_installer.exe')
.option('--notarize', 'notarize the macOS app with Apple')
.arguments('[build_config]')
.action(createDist)

Expand Down

0 comments on commit c3508d7

Please sign in to comment.