Skip to content

Commit e5281d8

Browse files
authored
Staple macOS notarization (#3062)
1 parent 75253f0 commit e5281d8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

elixirkit/elixirkit_swift/Scripts/build_macos_dmg.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ cp -r $app_dir $dmg_dir/
3737

3838
hdiutil create $dmg_path -ov -volname ${app_name}Install -fs HFS+ -srcfolder $dmg_dir
3939

40-
if [ -n "$team_id" ]; then
41-
codesign --verify --verbose=4 "${app_dir}"
42-
43-
codesign --sign="$identity" "$dmg_path"
40+
if [ -n "$identity" ]; then
41+
codesign --sign "$identity" "$dmg_path"
4442
codesign --verify --verbose=4 "$dmg_path"
43+
fi
4544

45+
if [ -n "$team_id" ]; then
4646
xcrun notarytool submit \
4747
--team-id "${team_id}" \
4848
--apple-id "${apple_id}" \
@@ -51,6 +51,8 @@ if [ -n "$team_id" ]; then
5151
--wait \
5252
"$dmg_path"
5353

54+
xcrun stapler staple "$dmg_path"
55+
xcrun stapler staple "$app_dir"
5456
spctl -a -t exec -vvv "$app_dir"
5557
else
5658
echo "[warning] skipping notarization. Please set ELIXIRKIT_NOTARY_{TEAM_ID,APPLE_ID,PASSWORD} environment variables"

0 commit comments

Comments
 (0)