2017-10-10 00:44:00 +02:00
|
|
|
# This script takes care of building your crate and packaging it for release
|
2016-02-23 14:57:10 +01:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
main() {
|
|
|
|
local src=$(pwd) \
|
|
|
|
stage=
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux)
|
|
|
|
stage=$(mktemp -d)
|
|
|
|
;;
|
|
|
|
osx)
|
|
|
|
stage=$(mktemp -d -t tmp)
|
|
|
|
;;
|
|
|
|
esac
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
test -f Cargo.lock || cargo generate-lockfile
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
# TODO Update this to build the artifacts that matter to you
|
2019-12-13 12:17:57 +01:00
|
|
|
cross rustc --bin hello --target $TARGET --release -- -C lto
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
# TODO Update this to package the right artifacts
|
2019-12-13 12:17:57 +01:00
|
|
|
cp target/$TARGET/release/hello $stage/
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
cd $stage
|
2017-10-11 02:27:59 +02:00
|
|
|
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
2017-10-10 00:44:00 +02:00
|
|
|
cd $src
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
rm -rf $stage
|
|
|
|
}
|
2016-02-23 14:57:10 +01:00
|
|
|
|
2017-10-10 00:44:00 +02:00
|
|
|
main
|