Skip to content

Commit

Permalink
preparing for travis deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lavifb committed Dec 8, 2018
1 parent 352fbcb commit dd939a3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ script:
- cargo build --verbose --all
- cargo test --verbose --all

before_deploy:
- sh ci/before_deploy.sh

deploy:
provider: releases
# NOTE updating the `api_key.secure`
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ assert_cmd = "0.10"
[[bench]]
name = "bench"
harness = false

[profile.release]
lto = true
35 changes: 35 additions & 0 deletions ci/before_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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)
;;
windows)
stage=$(mktemp -d)
;;
esac

test -f Cargo.lock || cargo generate-lockfile

cargo build --target "$TARGET" --release --verbose

# TODO Update this to package the right artifacts
cp "target/$TARGET/release/$PROJECT_NAME" $stage/

cd $stage
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
cd $src

rm -rf $stage
}

main

0 comments on commit dd939a3

Please sign in to comment.