2016-03-08 07:13:49 +08:00
|
|
|
# `before_deploy` phase: here we package the build artifacts
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-04-14 05:48:57 +08:00
|
|
|
mktempd() {
|
|
|
|
echo $(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
|
|
|
}
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2016-04-14 05:48:57 +08:00
|
|
|
mk_artifacts() {
|
|
|
|
cargo build --target $TARGET --release
|
|
|
|
}
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2016-04-14 05:48:57 +08:00
|
|
|
mk_tarball() {
|
|
|
|
local td=$(mktempd)
|
|
|
|
local out_dir=$(pwd)
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2016-04-14 05:48:57 +08:00
|
|
|
cp target/$TARGET/release/mdbook $td
|
2016-03-08 07:13:49 +08:00
|
|
|
|
2016-04-14 05:48:57 +08:00
|
|
|
pushd $td
|
|
|
|
|
2017-09-03 22:31:15 +08:00
|
|
|
tar czf $out_dir/${PROJECT_NAME}-${TRAVIS_TAG}-${TRAVIS_OS_NAME}.tar.gz *
|
2016-04-14 05:48:57 +08:00
|
|
|
|
|
|
|
popd $td
|
|
|
|
rm -r $td
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
mk_artifacts
|
|
|
|
mk_tarball
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|