Skip to content

Commit

Permalink
Fix release packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
ludocode committed Aug 23, 2021
1 parent 5706a64 commit 3d7dda3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tools/package.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
#!/bin/bash -v
#!/bin/bash
# Packages MPack up for amalgamation release. You can run tools/amalgamate.sh
# instead of this script if you just want to generate mpack.h/mpack.c.
# instead of this script if you just want to generate mpack.h and mpack.c.

set -v
set -e

[[ -z $(git status --porcelain) ]] || { git status --porcelain; echo "Tree is not clean!" ; exit 1; }
"`dirname $0`"/clean.sh

# generate package contents
. "`dirname $0`"/amalgamate.sh
. "`dirname $0`"/gendocs.sh
cp -ar build/docs/html build/amalgamation/docs
cp -ar .build/docs/html .build/amalgamation/docs
sed -i '/#define MPACK_AMALGAMATED 1/a\
#define MPACK_RELEASE_VERSION 1' build/amalgamation/src/mpack/mpack.h
#define MPACK_RELEASE_VERSION 1' .build/amalgamation/src/mpack/mpack.h

# create package
NAME=mpack-amalgamation-$VERSION
tar -C build/amalgamation --transform "s@^@$NAME/@" -czf build/$NAME.UNTESTED.tar.gz `ls build/amalgamation` || exit $?
tar -C .build/amalgamation --transform "s@^@$NAME/@" -czf .build/$NAME.UNTESTED.tar.gz `ls .build/amalgamation` || exit $?

# build and run all unit tests
pushd build/amalgamation
scons -j4 all=1 || exit $?
pushd .build/amalgamation
tools/unit.sh all || exit $?
popd

# done!
mv build/$NAME.UNTESTED.tar.gz $NAME.tar.gz
mv .build/$NAME.UNTESTED.tar.gz $NAME.tar.gz
echo Created $NAME.tar.gz

0 comments on commit 3d7dda3

Please sign in to comment.