view deploy/clean-build-and-package @ 399:a3912193ce69 tip

Default branch is now named default on git as well as hg, in case we ever want to switch to mirroring in the other direction
author Chris Cannam
date Thu, 27 Aug 2020 15:57:37 +0100
parents c9b2dca061a6
children
line wrap: on
line source
#!/bin/bash

set -eu

current=$(hg id | awk '{ print $1; }')

case "$current" in
    *+) echo "ERROR: Current working copy has been modified - not proceeding";exit 2;;
    *);;
esac

version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`

mkdir -p packages
echo

if [ -d /Applications ]; then

    qmake="$HOME/code/qt-builds/qt-5.14.2-static-nogui/bin/qmake"

    echo "Proceed to rebuild, package, and sign version $version using"
    echo -n "qmake path \"$qmake\" [Yn] ? "
    read yn
    case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
    echo "Proceeding"

    ./repoint install

    rm -rf .qmake.stash
    "$qmake" -r
    make clean
    make -j3

    deploy/osx/sign.sh sonic-annotator
    deploy/osx/notarize.sh sonic-annotator

    dir="sonic-annotator-$version-macos"
    mkdir -p "$dir"
    cp sonic-annotator "$dir/"
    cp README.md CHANGELOG COPYING CITATION "$dir/"
    tar cvzf "$dir.tar.gz" "$dir"
    rm -rf "$dir"

    mv "$dir.tar.gz" packages/

else

    echo -n "Proceed to rebuild and package version $version [Yn] ? "
    read yn
    case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
    echo "Proceeding"

    ./deploy/linux/build-and-test-appimage.sh

    squashedversion=$(echo "$version" | sed 's/_-//g')

    dir="sonic-annotator-$version-linux64-static"

    (
        cd deploy/linux/docker/output
        mkdir -p "$dir"
        cp SonicAnnotator-"$current"-x86_64.AppImage "$dir/sonic-annotator"
        chmod +x "$dir/sonic-annotator"
        cp ../../../../README.md "$dir"
        cp ../../../../CHANGELOG "$dir"
        cp ../../../../COPYING "$dir"
        cp ../../../../CITATION "$dir"
        tar cvzf "$dir.tar.gz" "$dir"
        rm -rf "$dir"
    )

    mv deploy/linux/docker/output/"$dir".tar.gz packages/

fi

echo "Done"