2024-06-19 22:46:33 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
x86|arm)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: release_macos.sh [platform]\n - platform: 'x86', 'arm'" >&2
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Setup build directory
|
|
|
|
BASEDIR=$(cd $(dirname $0) && pwd)
|
|
|
|
cd ${BASEDIR}
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Setup platform argument
|
|
|
|
[[ $1 == "x86" ]] && arch+=(x86_64-unknown-linux-gnu)
|
|
|
|
[[ $1 == "arm" ]] && arch+=(aarch64-unknown-linux-gnu)
|
|
|
|
|
|
|
|
# Start release build with zig linker for cross-compilation
|
|
|
|
cargo install cargo-zigbuild
|
|
|
|
cargo zigbuild --release --target ${arch}
|
|
|
|
|
|
|
|
# Create AppImage with https://github.com/AppImage/appimagetool
|
2024-06-20 13:27:14 +03:00
|
|
|
cp target/${arch}/release/grim linux/Grim.AppDir/AppRun
|
2024-06-19 22:46:33 +03:00
|
|
|
rm target/${arch}/release/*.AppImage
|
2024-06-20 13:27:14 +03:00
|
|
|
appimagetool linux/Grim.AppDir
|
2024-06-19 22:46:33 +03:00
|
|
|
mv *.AppImage target/${arch}/release/Grim-0.1.0-linux-$1.AppImage
|