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