diff --git a/.travis.yml b/.travis.yml index 3e642f30..b7254f30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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" diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh new file mode 100755 index 00000000..ec91dcd2 --- /dev/null +++ b/ci/before_deploy.sh @@ -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" diff --git a/ci/before_install.sh b/ci/before_install.sh index 518cdca0..9ec4562f 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -13,4 +13,4 @@ if [ "$TRAVIS_OS_NAME" == linux ] && [ "$HOST" != "${TARGET:-$HOST}" ]; then rustup target add "$TARGET"; fi -rustup self update \ No newline at end of file +rustup self update