#!/bin/sh # A script to package release binaries + README.md into zip files. # Usage: cd outfly; doc/scripts/pack.sh set -e if [ "$1" == "-b" ]; then cargo build --release --target=x86_64-unknown-linux-gnu --features "x11 wayland" cargo build --release --target=x86_64-pc-windows-gnu --no-default-features fi VERSION="$(sed -nr 's/^\s*version\s*=\s*"(.*)"\s*$/\1/p' Cargo.toml)" test -z "$VERSION" && echo 'Error: Could not extract version from Cargo.toml' && exit echo "Extracted version from Cargo.toml: $VERSION" TMPPATH=ZIP_TMP_PATH mkdir "$TMPPATH" cd "$TMPPATH" SRCPATH="outfly_v$VERSION" mkdir "$SRCPATH" cp ../README.md "$SRCPATH" cp ../target/x86_64-pc-windows-gnu/release/outfly.exe "$SRCPATH" zip -v -r -9 ../"outfly_v${VERSION}_windows.zip" "$SRCPATH" rm "$SRCPATH"/outfly.exe cp ../target/release/outfly "$SRCPATH" zip -v -r -9 ../"outfly_v${VERSION}_linux.zip" "$SRCPATH" cd .. rm -rf "$TMPPATH"