Create the bundle as a "fat binary" supporting the M1
This commit is contained in:
parent
1f06d216b5
commit
52a5777fbd
2 changed files with 15 additions and 4 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -50,4 +50,4 @@ jobs:
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Zed.dmg
|
name: Zed.dmg
|
||||||
path: target/release/bundle/Zed.dmg
|
path: target/release/Zed.dmg
|
||||||
|
|
|
@ -2,14 +2,25 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Build the app bundle for x86_64
|
||||||
pushd zed > /dev/null
|
pushd zed > /dev/null
|
||||||
cargo bundle --release
|
cargo bundle --release --target x86_64-apple-darwin
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
hdiutil create -volname Zed -srcfolder target/release/bundle/osx -ov -format UDZO target/release/bundle/Zed.dmg
|
|
||||||
|
|
||||||
|
# Build the binary for aarch64 (Apple M1)
|
||||||
|
cargo build --release --target aarch64-apple-darwin
|
||||||
|
|
||||||
|
# Replace the bundle's binary with a "fat binary" that combines the two architecture-specific binaries
|
||||||
|
lipo -create target/x86_64-apple-darwin/release/Zed target/aarch64-apple-darwin/release/Zed -output target/x86_64-apple-darwin/release/bundle/osx/Zed.app/Contents/MacOS/zed
|
||||||
|
|
||||||
|
# Create a DMG
|
||||||
|
mkdir -p target/release
|
||||||
|
hdiutil create -volname Zed -srcfolder target/x86_64-apple-darwin/release/bundle/osx -ov -format UDZO target/release/Zed.dmg
|
||||||
|
|
||||||
|
# If -o option is specified, open the target/release directory in Finder to reveal the DMG
|
||||||
while getopts o flag
|
while getopts o flag
|
||||||
do
|
do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
o) open target/release/bundle;;
|
o) open target/release;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue