1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/bash
# This is macOS-specific portion of the release script.
#
# Assumptions:
# - "macos" alias in ~/.ssh/config or defined $REMOTE_NAME
set -eu
REMOTE_NAME=${REMOTE_NAME:-macos}
function die() {
echo "error:" "$@" 1>&2
exit 1
}
function usage() {
echo "Usage: $0 version"
exit 1
}
function report() {
echo ">>>" "$@"
}
if [ $# -ne 1 ]; then
usage
fi
version=$1
case "${version/%-beta}" in
[0-9].[0-9][0-9].[0-9]);;
[0-9].[0-9].[0-9]);;
[0-9].[0-9][0-9]);;
[0-9].[0-9]);;
*)
die "unrecognized version format: '$version'"
esac
dir=vifm-$version
archive=$dir.tar.bz2
report "Uploading '$archive'..."
scp "$archive" "$REMOTE_NAME:"
report "Building v$version remotely..."
ssh "$REMOTE_NAME" bash - << EOF
set -eu
rm -rf "$dir"
tar xf "$archive"
( cd "$dir" && ./configure && make -j$(nproc) && make -j$(nproc) check )
EOF
report Success
|