language: rust rust: - stable - beta os: - linux - osx - windows jobs: fast_finish: true exclude: - if: tag IS present rust: beta branches: only: - master - /^\d+\.\d+(\.\d+)?(-\S*)?$/ before_install: - export RUST_BACKTRACE=1 - | if [[ $TRAVIS_OS_NAME == "linux" ]]; then export TARGET=x86_64-unknown-linux-gnu; elif [[ $TRAVIS_OS_NAME == "windows" ]]; then export TARGET=x86_64-pc-windows-msvc; if [[ -n $TRAVIS_TAG ]]; then powershell Install-WindowsFeature Net-Framework-Core; choco install -y wixtoolset; export PATH=$PATH:"/c/Program Files (x86)/WiX Toolset v3.11/bin"; fi elif [[ $TRAVIS_OS_NAME == "osx" ]]; then export TARGET=x86_64-apple-darwin; fi before_script: - rustup target add $TARGET - rustup component add clippy script: - cargo clippy -- -D clippy::all - cargo test --verbose --target $TARGET cache: cargo notifications: email: on_success: never before_deploy: - cargo install --path . --target $TARGET --locked --force; - | if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install zip; rustup target add x86_64-pc-windows-msvc; cargo build --release --target x86_64-pc-windows-msvc; mv "./target/x86_64-pc-windows-msvc/release/btm" "btm.exe"; strip "btm.exe" zip bottom_x86_64-pc-windows-msvc.zip "btm.exe"; rm "btm.exe" rustup target add i686-pc-windows-msvc; cargo build --release --target i686-pc-windows-msvc; mv "./target/i686-pc-windows-msvc/release/btm" "btm.exe"; strip "btm.exe" zip bottom_i686-pc-windows-msvc.zip "btm.exe"; rm "btm.exe" python "./deployment/windows/choco/choco_packager.py" "bottom_i686-pc-windows-msvc.zip" "bottom_x86_64-pc-windows-msvc.zip" $TRAVIS_TAG "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolateyinstall.ps1.template" "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/chocolateyinstall.ps1" "./deployment/windows/choco/tools/"; cd "./deployment/windows/choco/" zip -r choco.zip "bottom.nuspec" "tools/"; cd "../../../"; mv "./deployment/windows/choco/choco.zip" "./choco.zip" cargo install cargo-wix; cargo wix init; cargo wix; python "./deployment/packager.py" $TRAVIS_TAG "./deployment/windows/winget/winget.yaml.template" "$TRAVIS_TAG.yaml" "SHA256" "./bottom_x86_64_installer.msi" ; else cargo build --release; cp ./target/release/btm btm; strip btm; if [[ $TRAVIS_OS_NAME == "linux" ]]; then tar -czvf bottom_x86_64-unknown-linux-gnu.tar.gz btm; python "./deployment/packager.py" $TRAVIS_TAG "./deployment/linux/arch/PKGBUILD_BIN.template" "./PKGBUILD_BIN" "SHA512" "./bottom_x86_64-unknown-linux-gnu.tar.gz"; curl -LO "https://github.com/ClementTsang/bottom/archive/$TRAVIS_TAG.tar.gz"; python "./deployment/packager.py" $TRAVIS_TAG "./deployment/linux/arch/PKGBUILD.template" "./PKGBUILD" "SHA512" "./$TRAVIS_TAG.tar.gz"; rm "$TRAVIS_TAG.tar.gz"; tar -czvf arch.tar.gz PKGBUILD_BIN PKGBUILD; cargo install cargo-deb; cargo deb; cp ./target/debian/bottom_*.deb .; elif [[ $TRAVIS_OS_NAME == "osx" ]]; then tar -czvf bottom_x86_64-apple-darwin.tar.gz btm; # The bottom.rb file must be generated AFTER, since it relies on the Linux binary file. fi fi deploy: provider: releases overwrite: true api_key: secure: ppBn0DnqZ+Rzb84doZQxYdUBQ0rVrZNIiH6ZSFEiCVJd0ttqXfOjK/qXbIf/zabwO0Olqz18jwd9piHjNigWRrHwX9N+YH0DZTM3f4WS2/2acvOP3AjSw6oERjYTwS5yKe/XP1sU11uL6O0oAxYFeiAkn7QOM7flVUE2BmmLAs2lLtQ+9ylmUeBGatrkTfQ0Z2i1o7p5mtI2fKUozpImtHq8TClQEsF4oQS5nvkHtpLuPQ0UrJ8vKZijDBeMuLbDkR121ujRnjoBt8+eXBRbwzAvVotwRozyol8noAN3i4VvYueId6oX7Y2DSEp26wnCuRXGurUnyya5JE55AKoevK+SUHRe5+29/2lPbC5d/etZt2tSX1AIJk9fHeIfRPSTzanIIyDpUzSGoMKjl1ARKGrgHYehRxMKpW0cC2xHSlQ+NrA5apLpXKr2IzpkGsxpAxLqRASbX2VJYCEL70WoJfXinZrxeDxXsaWBLGaj9ySyk059GZBMz9GBdYNtwF3G/3aSIt0nkEGgKipgYXHi5keKKGmyfeZyYkRJRbc369JRZiHuOWct+1ZsOdrKKdbyAdcDGj5kbKuYwA6E+wgI62IWvUTm+vtKDuIbLpu/48aOUuEslGHkYAszLTapX/Le9c9XTu3L+PMgkPq2LSyaeGrfnM+DE/Hwe3Jvurccp94= file_glob: true file: - bottom_*.tar.gz - bottom_*.zip - bottom_*.deb - arch.tar.gz - bottom.rb - choco.zip - bottom_x86_64_installer.msi - $TRAVIS_TAG.yaml skip_cleanup: true on: tags: true condition: "$TRAVIS_RUST_VERSION = stable" repo: ClementTsang/bottom draft: true