Skip to content

Commit 2c8cfce

Browse files
committed
MONGOSH-2163: set macnotary to sign during PRs
1 parent 857f277 commit 2c8cfce

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.evergreen.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3965,6 +3965,7 @@ functions:
39653965
PACKAGE_VARIANT: ${package_variant}
39663966
MACOS_NOTARY_KEY: ${macos_notary_key}
39673967
MACOS_NOTARY_SECRET: ${macos_notary_secret}
3968+
REQUESTER: ${requester}
39683969
verify_artifact:
39693970
- command: expansions.write
39703971
type: setup

.evergreen/sign-packaged-artifact.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export NODE_JS_VERSION=${NODE_JS_VERSION}
66
export ARTIFACT_URL_FILE="$PWD/../artifact-url.txt"
77

88
source .evergreen/setup-env.sh
9+
notarymode="notarizeAndSign"
10+
11+
if [ "$REQUESTER" == "github_pr" ]; then
12+
notarymode="sign"
13+
fi
914

1015
(mkdir -p dist/ && cd dist/ && bash "$BASEDIR/retry-with-backoff.sh" curl -sSfLO --url "$(cat "$ARTIFACT_URL_FILE")")
1116
ls -lh dist/
@@ -24,15 +29,20 @@ if [ "$(uname)" == Darwin ]; then
2429
# notarize the client
2530
./darwin_amd64/macnotary \
2631
-f "$FILE" \
27-
-m notarizeAndSign -u https://dev.macos-notary.build.10gen.cc/api \
32+
-m $notarymode -u https://dev.macos-notary.build.10gen.cc/api \
2833
-b com.mongodb.mongosh \
2934
-e config/macos-entitlements.xml \
3035
-o "$FILE-signed.zip"
3136
mv -v "$FILE-signed.zip" "$FILE"
3237

33-
# Verify signing
38+
# Verify signing and notarization
3439
unzip "$FILE"
35-
spctl -a -vvv -t install mongosh-*/bin/mongosh
40+
if [ "$notarymode" == "sign" ]; then
41+
codesign --verify --deep --strict --verbose=2 mongosh-*/bin/mongosh
42+
else
43+
spctl -a -vvv -t install mongosh-*/bin/mongosh
44+
fi
45+
3646
else
3747
npm run evergreen-release sign
3848
fi

0 commit comments

Comments
 (0)