From 57263ee534cb27e8942c71b7068cd2a6fcf78104 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Dec 07 2020 11:03:23 +0000 Subject: publishing script --- diff --git a/.gitignore b/.gitignore index 2e4c459..2d41bae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /copy/ /build/ /build-release/ +/build-sources/ .sconsign* .pydevproject *.kate-swp diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..e55d830 --- /dev/null +++ b/publish.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -e + +ROOT="$(cd `dirname "$0"`; pwd)" +cd "$ROOT" + +VER="$(git describe --tags)" +PUBDIR="$ROOT/build-publish" +mkdir -p "$PUBDIR" + + +# build win +if [ "$1" != "fast" ]; then + echo " -- build win -- " + cd "$ROOT/win" + ./rebuild-heli-win.sh + cd "$ROOT" +fi + + +# prepare sources +echo " -- prepare sources -- " +SRCNAME="helianthus-src-$VER" +SRCDIR="$PUBDIR/$SRCNAME" +rm -rf "$SRCDIR" +mkdir -p "$SRCDIR" +cd "$SRCDIR" +git --work-tree=. checkout . +cd "$ROOT" + + +# prepare binaries +echo " -- prepare binaries -- " +BINNAME="helianthus-bin-$VER" +BINDIR="$PUBDIR/$BINNAME" +rm -rf "$BINDIR" +cp -r "$ROOT/win/release" "$BINDIR" +cp -r "$ROOT/win/unpack" "$BINDIR/src" +rm -f "$BINDIR/src/"*.done +cp -r "$SRCDIR" "$BINDIR/src/" +echo "Binary files licensed under GPL. Look license notes in src directory and subdirectories" >> "$BINDIR/readme" + + +# prepare archives +cd "$PUBDIR" +echo " -- prepare archives -- " +rm -f "$BINNAME.tar.gz" +rm -f "$SRCNAME.tar.gz" +rm -f "$BINNAME.zip" +rm -f "$SRCNAME.zip" +echo "$BINNAME.tar.gz" +tar -czf "$BINNAME.tar.gz" "$BINNAME" +echo "$SRCNAME.tar.gz" +tar -czf "$SRCNAME.tar.gz" "$SRCNAME" +echo "$BINNAME.zip" +zip -rq "$BINNAME.zip" "$BINNAME" +echo "$SRCNAME.zip" +zip -rq "$SRCNAME.zip" "$SRCNAME" +cd "$ROOT" + +echo " -- done -- "