mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
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
|
||||
with:
|
||||
name: Zed.dmg
|
||||
path: target/release/bundle/Zed.dmg
|
||||
path: target/release/Zed.dmg
|
||||
|
|
|
@ -2,14 +2,25 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Build the app bundle for x86_64
|
||||
pushd zed > /dev/null
|
||||
cargo bundle --release
|
||||
cargo bundle --release --target x86_64-apple-darwin
|
||||
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
|
||||
do
|
||||
case "${flag}" in
|
||||
o) open target/release/bundle;;
|
||||
o) open target/release;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue