2017-12-30 19:15:17 +08:00
|
|
|
# This script takes care of building your crate and packaging it for release
|
2016-03-08 07:13:49 +08:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2017-12-30 19:15:17 +08:00
|
|
|
main() {
|
|
|
|
local src=$(pwd) \
|
|
|
|
stage=
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2017-12-30 19:15:17 +08:00
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux)
|
|
|
|
stage=$(mktemp -d)
|
|
|
|
;;
|
|
|
|
osx)
|
|
|
|
stage=$(mktemp -d -t tmp)
|
|
|
|
;;
|
|
|
|
esac
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2018-04-07 15:47:08 +08:00
|
|
|
cargo rustc --bin mdbook --target $TARGET --release -- -C lto
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2018-04-07 15:47:08 +08:00
|
|
|
cp target/release/mdbook $stage/
|
2016-04-14 05:48:57 +08:00
|
|
|
|
2017-12-30 19:15:17 +08:00
|
|
|
cd $stage
|
|
|
|
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
|
|
|
cd $src
|
2016-04-14 05:48:57 +08:00
|
|
|
|
2017-12-30 19:15:17 +08:00
|
|
|
rm -rf $stage
|
2016-04-14 05:48:57 +08:00
|
|
|
}
|
|
|
|
|
2018-04-07 15:47:08 +08:00
|
|
|
main
|