Skip to content

Commit

Permalink
Setup CD pipeline
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
ilai-deutel committed Feb 13, 2020
1 parent 7ae62ef commit 45eff87
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
rust: nightly

# Static checks
- name: "LoC and style tests"
- name: LoC and style tests
before_script: rustup component add rustfmt clippy
script:
- cargo test --test loc
- cargo fmt -- --check
- cargo clippy --all-targets -- -D warnings
- name: "Dependency Audit"
- name: Dependency Audit
install: cargo install cargo-audit
script: cargo audit
cache: cargo
Expand All @@ -46,3 +46,16 @@ cache: false
install: cargo build --target "${TARGET:-$HOST}" --verbose

script: skip

before_deploy: ci/before_deploy.sh

deploy:
provider: releases
api_key:
secure: Va5HQGJoUwfnsxN8L1zI2RkSt1s0az7v7/NHxQMTv8SffaDOJuhbeWXsr9vFHNIE8wUC2mkLOd6rAGZ9YCtRUKS4nAucPk0gUD083y34j1DMLh6ycMjFtuWdWCaUMHaVqZjXPMCdeL7xZ6SuWqjhBDcOhDW3c63/caCSY6BlLQ2EFfT/GRscO2AzrRW0emHU3S8d9BgTX3YxSvJJnBZaUdLEbHQdLw/6m30MgaUwnPodxjRqzxNSJ+yReDJqwYvLCYCdYvNLlhA5MXM4GfgOsIWFdS1nMUyVKjpDf80f/BRUSLPst9uZ/6EBnFsUOTF7Vfw6FgNknNaqk7dHatIy5bWjjB6z8SPZAwzfnYCFNpFu6567/9i0PUxWd0g8L1lRGf0P+Y2rMJmV2LWpL4zjb7lDUHf9Hbg3ueY/yLguhi/ic7U2+ok2S4OCH+uDs1uSsekpyxYhqHL4zcFxtUTi1zasRI1NEVJr9CcAVoR4p/83N6rX5/0xR7pdhCfDGTlBQQH0AjHU/q8GhVw2mVlyQqefNBszjHrG9tI1oWcRmSruWMG7HX4m3BAci2T1/MlJSmUiwQ27eaBHLw6fROvkH2RD3kowRsM3oCRN6OQLf/HD5OnLfqKhGEaYlAfzpf9O6tQZSCHbIST4rhLYdCkGofNiPjSa3tErmoxWFNhm57E=
file: kibi-$TRAVIS_TAG-$TARGET.tar.gz
skip_cleanup: true
draft: true
on:
tags: true
condition: $TRAVIS_RUST_VERSION = stable && -n "$TARGET"
19 changes: 19 additions & 0 deletions ci/before_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euxo pipefail

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

tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
package_name="kibi-$TRAVIS_TAG-$TARGET"

mkdir "$tempdir/$package_name"

cp "target/$TARGET/release/kibi" "$tempdir/$package_name/"
strip "$tempdir/$package_name/kibi"

cp -r README.md COPYRIGHT LICENSE-APACHE LICENSE-MIT config_example "$tempdir/$package_name/"

tar czvf "$package_name.tar.gz" -C "$tempdir/$package_name" .

rm -rv "$tempdir"
2 changes: 1 addition & 1 deletion ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ if [ "$TRAVIS_OS_NAME" == linux ] && [ "$HOST" != "${TARGET:-$HOST}" ]; then
rustup target add "$TARGET";
fi

rustup self update
rustup self update

0 comments on commit 45eff87

Please sign in to comment.