2018-06-04 22:41:08 +03:00
|
|
|
# This script takes care of building your crate and packaging it for release
|
|
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
|
|
main() {
|
2019-08-13 21:55:31 +03:00
|
|
|
src=$(pwd)
|
2018-06-04 22:41:08 +03:00
|
|
|
|
2019-08-13 21:55:31 +03:00
|
|
|
case "$TRAVIS_OS_NAME" in
|
2018-06-04 22:41:08 +03:00
|
|
|
linux)
|
|
|
|
|
stage=$(mktemp -d)
|
|
|
|
|
;;
|
|
|
|
|
osx)
|
|
|
|
|
stage=$(mktemp -d -t tmp)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
test -f Cargo.lock || cargo generate-lockfile
|
|
|
|
|
|
|
|
|
|
# TODO Update this to build the artifacts that matter to you
|
2019-08-13 21:55:31 +03:00
|
|
|
cross rustc --bin topgrade --target "$TARGET" --release --all-features -- -C lto
|
2018-06-04 22:41:08 +03:00
|
|
|
|
|
|
|
|
# TODO Update this to package the right artifacts
|
2019-08-13 21:55:31 +03:00
|
|
|
cp target/"$TARGET"/release/topgrade "$stage"/
|
2018-06-04 22:41:08 +03:00
|
|
|
|
2019-08-13 21:55:31 +03:00
|
|
|
cd "$stage"
|
|
|
|
|
tar czf "$src"/"$CRATE_NAME"-"$TRAVIS_TAG"-"$TARGET".tar.gz ./*
|
|
|
|
|
cd "$src"
|
2018-06-04 22:41:08 +03:00
|
|
|
|
2019-08-13 21:55:31 +03:00
|
|
|
rm -rf "$stage"
|
2018-06-04 22:41:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main
|