Ensure only the just-built app bundle is included in the DMG

This commit is contained in:
Max Brunsfeld 2022-10-26 21:06:06 -07:00
parent aa9ccf3411
commit df708465d1

View file

@ -28,10 +28,10 @@ sed \
-i .backup \ -i .backup \
"s/package.metadata.bundle-${channel}/package.metadata.bundle/" \ "s/package.metadata.bundle-${channel}/package.metadata.bundle/" \
Cargo.toml Cargo.toml
rm -rf target/x86_64-apple-darwin/release/bundle
app_path=$(cargo bundle --release --target x86_64-apple-darwin | xargs) app_path=$(cargo bundle --release --target x86_64-apple-darwin | xargs)
mv Cargo.toml.backup Cargo.toml mv Cargo.toml.backup Cargo.toml
popd popd
echo "Bundled ${app_path}"
echo "Creating fat binaries" echo "Creating fat binaries"
lipo \ lipo \
@ -67,8 +67,10 @@ else
fi fi
echo "Creating DMG" echo "Creating DMG"
mkdir -p target/release mkdir -p target/release/dmg
hdiutil create -volname Zed -srcfolder target/x86_64-apple-darwin/release/bundle/osx -ov -format UDZO target/release/Zed.dmg rm -rf target/release/dmg/*
mv "${app_path}" target/release/dmg/
hdiutil create -volname Zed -srcfolder target/release/dmg -ov -format UDZO target/release/Zed.dmg
if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then
echo "Notarizing DMG with Apple" echo "Notarizing DMG with Apple"