build: fix macos
This commit is contained in:
parent
6136b41916
commit
92eb5f59ad
1 changed files with 7 additions and 6 deletions
|
@ -5,7 +5,7 @@ case $2 in
|
||||||
x86_64|arm|universal)
|
x86_64|arm|universal)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: release_macos.sh [platform]\n - platform: 'x86_64', 'arm', 'universal'" >&2
|
echo "Usage: release_macos.sh [version] [platform]\n - platform: 'x86_64', 'arm', 'universal'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -36,19 +36,20 @@ rm -rf target/aarch64-apple-darwin
|
||||||
[[ $2 == "universal" ]] && arch+=(universal2-apple-darwin)
|
[[ $2 == "universal" ]] && arch+=(universal2-apple-darwin)
|
||||||
|
|
||||||
# Start release build with zig linker for cross-compilation
|
# Start release build with zig linker for cross-compilation
|
||||||
# zig 0.12 required
|
# zig 0.12+ required
|
||||||
cargo install cargo-zigbuild@0.18.4
|
cargo install cargo-zigbuild
|
||||||
cargo zigbuild --release --target ${arch}
|
cargo zigbuild --release --target ${arch}
|
||||||
rm -rf .intentionally-empty-file.o
|
rm -rf .intentionally-empty-file.o
|
||||||
|
mkdir macos/Grim.app/Contents/MacOS
|
||||||
yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS
|
yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS
|
||||||
|
|
||||||
### Sign .app resources:
|
### Sign .app resources on change:
|
||||||
#rcodesign generate-self-signed-certificate
|
#rcodesign generate-self-signed-certificate
|
||||||
#rcodesign sign --pem-file cert.pem macos/Grim.app
|
#rcodesign sign --pem-file cert.pem macos/Grim.app
|
||||||
|
|
||||||
# Create release package
|
# Create release package
|
||||||
FILE_NAME=Grim-$1-macos-$2.zip
|
FILE_NAME=grim-v$1-macos-$2.zip
|
||||||
rm -rf target/${arch}/release/${FILE_NAME}
|
rm -rf target/${arch}/release/${FILE_NAME}
|
||||||
cd macos
|
cd macos
|
||||||
zip -r ${FILE_NAME} Grim.app
|
zip -r ${FILE_NAME} Grim.app
|
||||||
mv ${FILE_NAME} ../target/${arch}/release
|
mv ${FILE_NAME} ../target/${arch}/release
|
||||||
|
|
Loading…
Reference in a new issue