Skip to content

Commit 2127e43

Browse files
committed
Pass our zip directly to notarizer
1 parent 684fa94 commit 2127e43

File tree

4 files changed

+210
-10
lines changed

4 files changed

+210
-10
lines changed

packages/build/src/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const createRelease = async(version: string, octokit: Octokit): Promise<any> =>
7777
* @param {string} uploadUrl - The release endpoint.
7878
* @param {Octokit} octokit - The octokit instance.
7979
*/
80-
const uploadAsset = async(artifact: string, platform: string, uploadUrl: string, octokit: Octokit) Promise<any> => {
80+
const uploadAsset = async(artifact: string, platform: string, uploadUrl: string, octokit: Octokit): Promise<any> => {
8181
const params = {
8282
method: 'POST',
8383
url: uploadUrl,

packages/build/src/macos-sign.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import util from 'util';
33
import codesign from 'node-codesign';
44
import { notarize as nodeNotarize } from 'electron-notarize';
55
import Config from './config';
6+
import zip from './zip';
67

7-
const notarize = (bundleId: string, executable: string, user: string, password: string) => {
8+
const notarize = (bundleId: string, artifact: string, user: string, password: string) => {
89
return nodeNotarize({
910
appBundleId: bundleId,
10-
appPath: executable,
11+
appPath: artifact,
1112
appleId: user,
1213
appleIdPassword: password
1314
});
@@ -25,22 +26,19 @@ const sign = (executable: string, identity: string) => {
2526
});
2627
};
2728

28-
const publish = async(executable: string, artifact: string, config: Config) => {
29-
// Remove the zip that was created since the notarize process will create a
30-
// new zip.
29+
const publish = async(executable: string, artifact: string, platform: string, config: Config) => {
3130
console.log('mongosh: removing unsigned zip:', artifact);
3231
await util.promisify(fs.unlink)(artifact);
3332
console.log('mongosh: signing:', executable);
3433
await sign(executable, config.appleAppIdentity).
3534
catch((e) => { console.error(e); throw e; });
3635
console.log('mongosh: notarizing and zipping:', executable);
36+
await zip(executable, config.outputDir, platform, config.version);
3737
await notarize(
3838
config.bundleId,
39-
executable,
39+
artifact,
4040
config.appleUser,
4141
config.applePassword).catch((e) => { console.error(e); throw e; });
42-
console.log('mongosh: renaming notarized zip:', artifact);
43-
await util.promisify(fs.rename)(`${executable}.zip`, artifact);
4442
};
4543

4644
export default publish;

packages/build/src/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const release = async(config: Config) => {
3939

4040
// Sign and notarize the executable and artifact for MacOs.
4141
if (platform === Platform.MacOs) {
42-
await publishMacOs(executable, artifact, config);
42+
await publishMacOs(executable, artifact, platform, config);
4343
}
4444

4545
// Create & sign the .rpm (only on linux)

packages/mapper/package-lock.json

Lines changed: 202 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)