28 lines
732 B
Bash
Executable file
28 lines
732 B
Bash
Executable file
#!/bin/sh
|
|
# A script to package release binaries + README.md into zip files.
|
|
# Usage: cd outfly; doc/scripts/pack.sh
|
|
|
|
set -e
|
|
|
|
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"
|