Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/build/src/run-draft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ describe('draft', () => {
});

it('uploads artifacts to download center', () => {
expect(uploadArtifactToDownloadCenter).to.have.been.callCount(ALL_BUILD_VARIANTS.length * 2);
expect(uploadArtifactToDownloadCenter).to.have.been.callCount(ALL_BUILD_VARIANTS.length);
});

it('uploads the artifacts to the github release', () => {
expect(uploadReleaseAsset).to.have.been.callCount(ALL_BUILD_VARIANTS.length * 2);
expect(uploadReleaseAsset).to.have.been.callCount(ALL_BUILD_VARIANTS.length);
});
});

Expand Down
14 changes: 10 additions & 4 deletions packages/build/src/run-draft.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { promises as fs } from 'fs';
import { promises as fs, constants as fsConstants } from 'fs';
import path from 'path';
import { ALL_BUILD_VARIANTS, Config, getReleaseVersionFromTag } from './config';
import { uploadArtifactToDownloadCenter as uploadArtifactToDownloadCenterFn } from './download-center';
Expand Down Expand Up @@ -52,12 +52,18 @@ export async function runDraft(
signingComment: 'Evergreen Automatic Signing (mongosh)'
}
);
const signatureFile = downloadedArtifact + '.sig';
let signatureFile: string | undefined = downloadedArtifact + '.sig';
try {
await fs.access(signatureFile, fsConstants.R_OK);
} catch (err: any) {
signatureFile = undefined;
console.info(`Skipping expected signature file ${signatureFile}: ${err.message}`);
}

await Promise.all([
[ downloadedArtifact, tarballFile.contentType ],
[ signatureFile, 'application/pgp-signature' ]
].flatMap(([ path, contentType ]) => [
].flatMap(([ path, contentType ]) => path ? [
uploadToDownloadCenter(
path,
config.downloadCenterAwsKey as string,
Expand All @@ -68,7 +74,7 @@ export async function runDraft(
githubReleaseTag,
{ path, contentType }
)
]));
] : []));
}
}

Expand Down