Skip to content
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

Migrate MacOS desktop to use notarytool to notarize #30599

Merged
merged 11 commits into from
Oct 31, 2023
6 changes: 3 additions & 3 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function getTestBuildMessage() {
const iOSQRCode = iOSSuccess ? `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})` : "The QR code can't be generated, because the iOS build failed";
const webQRCode = webSuccess ? `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})` : "The QR code can't be generated, because the web build failed";

const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube:
| android :robot: | iOS :apple: |
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
| Android :robot: | iOS :apple: |
| ------------- | ------------- |
| ${androidLink} | ${iOSLink} |
| ${androidQRCode} | ${iOSQRCode} |
| desktop :computer: | web :spider_web: |
| Desktop :computer: | Web :spider_web: |
| ${desktopLink} | ${webLink} |
| ${desktopQRCode} | ${webQRCode} |`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function getTestBuildMessage() {
const iOSQRCode = iOSSuccess ? `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})` : "The QR code can't be generated, because the iOS build failed";
const webQRCode = webSuccess ? `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})` : "The QR code can't be generated, because the web build failed";

const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube:
| android :robot: | iOS :apple: |
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
| Android :robot: | iOS :apple: |
| ------------- | ------------- |
| ${androidLink} | ${iOSLink} |
| ${androidQRCode} | ${iOSQRCode} |
| desktop :computer: | web :spider_web: |
| Desktop :computer: | Web :spider_web: |
| ${desktopLink} | ${webLink} |
| ${desktopQRCode} | ${webQRCode} |`;

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:

- name: Build production desktop app
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: npm run desktop-build -- --publish always
run: npm run desktop-build
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
Expand All @@ -165,7 +165,7 @@ jobs:

- name: Build staging desktop app
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: npm run desktop-build-staging -- --publish always
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - notarize/electron will look at env variables to determine if we should notarize or not.

run: npm run desktop-build-staging
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Build desktop app for testing
run: npm run desktop-build-adhoc -- --publish always
run: npm run desktop-build-adhoc
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
body-include: 'Use the links below to test this build in android and iOS. Happy testing!'
body-include: 'Use the links below to test this adhoc build in Android, iOS, Desktop, and Web. Happy testing!'
number: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
delete: true

Expand Down
8 changes: 4 additions & 4 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const {version} = require('../package.json');

const isPublishing = process.argv.includes('--publish');
const pullRequestNumber = process.env.PULL_REQUEST_NUMBER;

const s3Bucket = {
Expand Down Expand Up @@ -28,8 +27,7 @@ if (!isCorrectElectronEnv) {
}

/**
* The configuration for the production and staging Electron builds.
* It can be used to create local builds of the same, by omitting the `--publish` flag
* The configuration for the debug, production and staging Electron builds.
*/
module.exports = {
appId: 'com.expensifyreactnative.chat',
Expand All @@ -44,6 +42,9 @@ module.exports = {
entitlements: 'desktop/entitlements.mac.plist',
entitlementsInherit: 'desktop/entitlements.mac.plist',
type: 'distribution',
notarize: {
teamId: '368M544MTT',
},
},
dmg: {
title: 'New Expensify',
Expand All @@ -58,7 +59,6 @@ module.exports = {
path: s3Path[process.env.ELECTRON_ENV],
},
],
afterSign: isPublishing ? './desktop/notarize.js' : undefined,
files: ['dist', '!dist/www/{.well-known,favicon*}'],
directories: {
app: 'desktop',
Expand Down
2 changes: 1 addition & 1 deletion contributingGuides/APPLE_GOOGLE_SIGNIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ If developing on MacOS, the development desktop app can't handle deeplinks corre
1. Create a "real" build of the desktop app, which can handle deep links, open the build folder, and install the dmg there:

```
npm run desktop-build --publish=never
npm run desktop-build
open desktop-build
# Then double-click "NewExpensify.dmg" in Finder window
```
Expand Down
20 changes: 0 additions & 20 deletions desktop/notarize.js

This file was deleted.

74 changes: 11 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.21.5",
"@babel/runtime": "^7.20.0",
"@electron/notarize": "^1.2.3",
"@electron/notarize": "^2.1.0",
"@jest/globals": "^29.5.0",
"@octokit/core": "4.0.4",
"@octokit/plugin-paginate-rest": "3.1.0",
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/postTestBuildComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const desktopQRCode = `![Desktop](https://api.qrserver.com/v1/create-qr-code/?si
const iOSQRCode = `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})`;
const webQRCode = `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})`;

const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube:
| android :robot: | iOS :apple: |
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
| Android :robot: | iOS :apple: |
| ------------- | ------------- |
| ${androidLink} | ${iOSLink} |
| ${androidQRCode} | ${iOSQRCode} |
| desktop :computer: | web :spider_web: |
| Desktop :computer: | Web :spider_web: |
| ${desktopLink} | ${webLink} |
| ${desktopQRCode} | ${webQRCode} |`;

Expand Down
Loading