forked from cliqz-oss/browser-f
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign_mac.sh
executable file
·40 lines (33 loc) · 875 Bytes
/
sign_mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
set -x
echo "***** MAC SIGNING *****"
PKG_DIR=obj/pkg
for DMG in obj/dist/*.dmg
do
echo "Processing $DMG..."
rm -f -rf $PKG_DIR
mkdir $PKG_DIR
hdiutil attach -nobrowse $DMG
cp -r /Volumes/cliqz/*.app $PKG_DIR
xattr -rc $PKG_DIR/
hdiutil detach /Volumes/cliqz
for app in $PKG_DIR/*.app
do
codesign -s $CQZ_CERT_NAME --force --deep $app
# copy back to dist folder a signed app (for generating an update package(s) later)
if [[ $DMG == *"de.mac.dmg"* ]]; then
cp -r $app obj/dist/l10n-stage/cliqz
fi
if [[ $DMG == *"en-US.mac.dmg"* ]]; then
cp -r $app obj/dist/cliqz
fi
done
SIGNED_DMG="${DMG%.dmg}-signed.dmg"
if [ -f $SIGNED_DMG ]; then
echo "File ${SIGNED_DMG} exists. Removing to continue"
rm $SIGNED_DMG
fi
appdmg -v cliqz-dmg.json $SIGNED_DMG
cp $SIGNED_DMG $DMG
done