Skip to content

Commit bf3721e

Browse files
committed
some improvements to pkgAndNotarize script
1 parent 4936b9a commit bf3721e

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

pkgAndNotarize.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@ install_location="/"
4747
SRCROOT=$(dirname ${0:A})
4848
build_dir="$SRCROOT/.build"
4949

50+
# verify signing certificates exist
51+
echo "### verifying certificates and credentials"
52+
53+
if ! security find-identity -v | grep -q "$application_sign_cert"; then
54+
echo "error: Application signing certificate not found: $application_sign_cert"
55+
exit 1
56+
fi
57+
58+
if ! security find-identity -v | grep -q "$installer_sign_cert"; then
59+
echo "error: Installer signing certificate not found: $installer_sign_cert"
60+
exit 1
61+
fi
62+
63+
# verify notarization credentials exist
64+
if ! xcrun notarytool store-credentials --list 2>/dev/null | grep -q "$credential_profile"; then
65+
echo "error: Notarization profile '$credential_profile' not found"
66+
echo "Run: xcrun notarytool store-credentials '$credential_profile' --apple-id <email> --team-id <team>"
67+
exit 1
68+
fi
69+
70+
echo "All certificates and credentials verified"
71+
echo
72+
5073
date +"%F %T"
5174

5275
# build the binary
@@ -109,10 +132,7 @@ echo "Min OS Version: $min_os_version"
109132
echo "Developer ID: $developer_name_and_id"
110133

111134
pkgroot="$build_dir/pkgroot"
112-
if [[ ! -d $pkgroot ]]; then
113-
mkdir -p $pkgroot
114-
fi
115-
135+
rm -rf $pkgroot
116136
mkdir -p $binary_location
117137
mkdir -p $manpage_location
118138

@@ -156,7 +176,7 @@ echo "### building component pkg file"
156176

157177
if ! pkgbuild --root $pkgroot \
158178
--identifier $identifier \
159-
--version $version-$build_number \
179+
--version $version \
160180
--install-location $install_location \
161181
--min-os-version $min_os_version \
162182
--compression latest \
@@ -174,7 +194,7 @@ echo "### building distribution pkg file"
174194

175195
if ! productbuild --package "$component_path" \
176196
--identifier "$identifier" \
177-
--version "$version-$build_number" \
197+
--version "$version" \
178198
--sign "$installer_sign_cert" \
179199
"$product_path"
180200
then

0 commit comments

Comments
 (0)