New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notarise the macOS app #11119
Merged
Merged
Notarise the macOS app #11119
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ff70339
Working branch for notarisation
dbkr bad97db
remove random spaces
dbkr 7faba49
fix quotes
dbkr 29f186b
add electron-notarize
dbkr a7d1d98
Use my fork of electron-notarize
dbkr 2bab328
Check everything's in place for the notarising dance
dbkr 0259eb6
Go back to upstream electron-notarize
dbkr 0712231
Warn that this might be a while
dbkr File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { notarize } = require('electron-notarize'); | ||
|
||
exports.default = async function(context) { | ||
const { electronPlatformName, appOutDir } = context; | ||
if (electronPlatformName !== 'darwin') { | ||
return; | ||
} | ||
|
||
// We get the password from keychain. The keychain stores | ||
// user IDs too, but apparently altool can't get the user ID | ||
// from the keychain, so we need to get it from the environment. | ||
const userId = process.env.NOTARIZE_APPLE_ID; | ||
if (userId === undefined) { | ||
throw new Exception("User ID not found. Set NOTARIZE_APPLE_ID."); | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename; | ||
|
||
console.log("Notarising macOS app. This may be some time."); | ||
return await notarize({ | ||
appBundleId: 'im.riot.app', | ||
appPath: `${appOutDir}/${appName}.app`, | ||
appleId: userId, | ||
appleIdPassword: '@keychain:NOTARIZE_CREDS', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who will set this env var? Can we manually extract it from keychain with
keychain find-generic-password ...
or similar?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just going to put it in the ~/.profile on the build machine. I'd hoped we'd be be able to just get it out of the keychain but I can't work out how to get the entry in a place in the keychain where both
altool
andsecurity
can find it...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I see... Well, probably it's fine. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the current method for getting this set up? I've tried
NOTARIZE_CREDS=foo yarn build:electron:macos
to no avail...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss this in #riot-dev.