summaryrefslogtreecommitdiffstats
path: root/ci/before_deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/before_deploy.sh')
-rw-r--r--ci/before_deploy.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh
new file mode 100644
index 0000000..7525d8c
--- /dev/null
+++ b/ci/before_deploy.sh
@@ -0,0 +1,31 @@
+# This script takes care of building your crate and packaging it for release
+
+set -ex
+
+main() {
+ local src=$(pwd) \
+ stage=
+
+ case $TRAVIS_OS_NAME in
+ linux)
+ stage=$(mktemp -d)
+ ;;
+ osx)
+ stage=$(mktemp -d -t tmp)
+ ;;
+ esac
+
+ test -f Cargo.lock || cargo generate-lockfile
+
+ cross rustc --bin so --target $TARGET --release -- -C lto
+
+ cp target/$TARGET/release/so $stage/
+
+ cd $stage
+ tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
+ cd $src
+
+ rm -rf $stage
+}
+
+main