build: versioning, ignore android keystore file

This commit is contained in:
ardocrat 2024-08-02 17:30:54 +03:00
parent fa0232d4c4
commit 1783c2e143
3 changed files with 14 additions and 14 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
android/.gradle
android/local.properties
android/keystore
android/keystore.asc
android/keystore.properties
/.idea
.DS_Store

View file

@ -1,10 +1,10 @@
#!/bin/bash
case $1 in
x86|arm)
case $2 in
x86_64|arm)
;;
*)
echo "Usage: release_macos.sh [platform]\n - platform: 'x86', 'arm'" >&2
echo "Usage: release_linux.sh [version] [platform]\n - platform: 'x86_64', 'arm'" >&2
exit 1
esac
@ -14,8 +14,8 @@ cd ${BASEDIR}
cd ..
# Setup platform argument
[[ $1 == "x86" ]] && arch+=(x86_64-unknown-linux-gnu)
[[ $1 == "arm" ]] && arch+=(aarch64-unknown-linux-gnu)
[[ $2 == "x86_64" ]] && arch+=(x86_64-unknown-linux-gnu)
[[ $2 == "arm" ]] && arch+=(aarch64-unknown-linux-gnu)
# Start release build with zig linker for cross-compilation
cargo install cargo-zigbuild
@ -24,5 +24,4 @@ cargo zigbuild --release --target ${arch}
# Create AppImage with https://github.com/AppImage/appimagetool
cp target/${arch}/release/grim linux/Grim.AppDir/AppRun
rm target/${arch}/release/*.AppImage
appimagetool linux/Grim.AppDir
mv *.AppImage target/${arch}/release/Grim-0.1.0-linux-$1.AppImage
appimagetool linux/Grim.AppDir target/${arch}/release/grim-v$1-linux-$2.AppImage

View file

@ -1,11 +1,11 @@
#!/bin/bash
set -e
case $1 in
x86|arm|all)
case $2 in
x86_64|arm|universal)
;;
*)
echo "Usage: release_macos.sh [platform]\n - platform: 'x86', 'arm', 'all'" >&2
echo "Usage: release_macos.sh [platform]\n - platform: 'x86_64', 'arm', 'universal'" >&2
exit 1
esac
@ -31,9 +31,9 @@ rustup target add aarch64-apple-darwin
rm -rf target/x86_64-apple-darwin
rm -rf target/aarch64-apple-darwin
[[ $1 == "x86" ]] && arch+=(x86_64-apple-darwin)
[[ $1 == "arm" ]] && arch+=(aarch64-apple-darwin)
[[ $1 == "all" ]] && arch+=(universal2-apple-darwin)
[[ $2 == "x86_64" ]] && arch+=(x86_64-apple-darwin)
[[ $2 == "arm" ]] && arch+=(aarch64-apple-darwin)
[[ $2 == "universal" ]] && arch+=(universal2-apple-darwin)
# Start release build with zig linker for cross-compilation
# zig 0.12 required
@ -47,7 +47,7 @@ yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS
#rcodesign sign --pem-file cert.pem macos/Grim.app
# Create release package
FILE_NAME=Grim-0.1.0-macos-$1.zip
FILE_NAME=Grim-$1-macos-$2.zip
rm -rf target/${arch}/release/${FILE_NAME}
cd macos
zip -r ${FILE_NAME} Grim.app