2017-12-30 11:15:17 +00:00
|
|
|
# This script takes care of building your crate and packaging it for release
|
2016-03-07 23:13:49 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2017-12-30 11:15:17 +00:00
|
|
|
main() {
|
|
|
|
local src=$(pwd) \
|
|
|
|
stage=
|
2016-03-07 23:13:49 +00:00
|
|
|
|
2017-12-30 11:15:17 +00:00
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux)
|
|
|
|
stage=$(mktemp -d)
|
|
|
|
;;
|
|
|
|
osx)
|
|
|
|
stage=$(mktemp -d -t tmp)
|
|
|
|
;;
|
|
|
|
esac
|
2016-03-07 23:13:49 +00:00
|
|
|
|
2018-07-26 18:18:33 +00:00
|
|
|
# This will slow down the build, but is necessary to not run out of disk space
|
|
|
|
cargo clean
|
|
|
|
|
2018-04-07 07:47:08 +00:00
|
|
|
cargo rustc --bin mdbook --target $TARGET --release -- -C lto
|
2016-03-07 23:13:49 +00:00
|
|
|
|
2018-07-24 19:12:27 +00:00
|
|
|
cp target/$TARGET/release/mdbook $stage/
|
2016-04-13 21:48:57 +00:00
|
|
|
|
2017-12-30 11:15:17 +00:00
|
|
|
cd $stage
|
|
|
|
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
|
|
|
cd $src
|
2016-04-13 21:48:57 +00:00
|
|
|
|
2017-12-30 11:15:17 +00:00
|
|
|
rm -rf $stage
|
2016-04-13 21:48:57 +00:00
|
|
|
}
|
|
|
|
|
2018-04-07 07:47:08 +00:00
|
|
|
main
|