2019-09-14 01:12:01 +02:00
|
|
|
language: rust
|
2020-09-02 08:59:51 +02:00
|
|
|
cache: cargo
|
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
on_success: never
|
|
|
|
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# Standard x86-64 stuff, stable and beta
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
|
|
arch: amd64
|
|
|
|
rust: stable
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
|
|
arch: amd64
|
|
|
|
rust: beta
|
|
|
|
- os: osx
|
|
|
|
env: TARGET=x86_64-apple-darwin
|
|
|
|
arch: amd64
|
|
|
|
rust: stable
|
|
|
|
- os: osx
|
|
|
|
env: TARGET=x86_64-apple-darwin
|
|
|
|
arch: amd64
|
|
|
|
rust: beta
|
|
|
|
- os: windows
|
|
|
|
env: TARGET=x86_64-pc-windows-msvc
|
|
|
|
arch: amd64
|
|
|
|
rust: stable
|
|
|
|
- os: windows
|
|
|
|
env: TARGET=x86_64-pc-windows-msvc
|
|
|
|
arch: amd64
|
|
|
|
rust: beta
|
|
|
|
|
|
|
|
# musl
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=x86_64-unknown-linux-musl
|
|
|
|
arch: amd64
|
|
|
|
rust: stable
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=x86_64-unknown-linux-musl
|
|
|
|
arch: amd64
|
|
|
|
rust: beta
|
|
|
|
|
|
|
|
# ARM stuff (skip beta for now, see https://github.com/rust-lang/rust/issues/62896)
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=aarch64-unknown-linux-gnu
|
|
|
|
arch: arm64
|
|
|
|
rust: stable
|
|
|
|
- os: linux
|
|
|
|
env: TARGET=armv7-unknown-linux-gnueabihf
|
|
|
|
arch: amd64
|
|
|
|
rust: stable
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages: &armhf
|
|
|
|
- gcc-arm-linux-gnueabihf
|
|
|
|
- libc6-armhf-cross
|
|
|
|
- libc6-dev-armhf-cross
|
|
|
|
|
2020-01-03 06:20:47 +01:00
|
|
|
fast_finish: true
|
2020-05-05 01:21:29 +02:00
|
|
|
exclude:
|
2020-05-05 01:47:21 +02:00
|
|
|
- if: tag IS present
|
|
|
|
rust: beta
|
2020-09-02 08:59:51 +02:00
|
|
|
- if: tag IS present
|
|
|
|
arch: arm64
|
|
|
|
- if: tag IS present
|
|
|
|
env: TARGET=armv7-unknown-linux-gnueabihf
|
|
|
|
allow_failures:
|
|
|
|
- arch: arm64 # ARM will be run, but support is still gonna be limited for now... may change.
|
|
|
|
- env: TARGET=armv7-unknown-linux-gnueabihf
|
|
|
|
|
2020-04-11 02:02:25 +02:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
|
2019-12-31 03:25:20 +01:00
|
|
|
|
2019-12-31 04:01:34 +01:00
|
|
|
before_install:
|
|
|
|
- export RUST_BACKTRACE=1
|
2019-12-31 04:09:35 +01:00
|
|
|
- |
|
2020-09-02 08:59:51 +02:00
|
|
|
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
|
2020-08-23 23:46:01 +02:00
|
|
|
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";
|
2020-08-31 23:50:21 +02:00
|
|
|
choco install zip;
|
|
|
|
rustup target add i686-pc-windows-msvc;
|
2020-08-23 23:46:01 +02:00
|
|
|
fi
|
2019-12-31 04:01:34 +01:00
|
|
|
fi
|
2020-09-02 08:59:51 +02:00
|
|
|
|
2020-02-10 06:26:34 +01:00
|
|
|
before_script:
|
|
|
|
- rustup target add $TARGET
|
2020-09-02 08:59:51 +02:00
|
|
|
- rustup update
|
|
|
|
- |
|
|
|
|
# Only check clippy if stable...
|
|
|
|
if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then
|
|
|
|
rustup component add clippy
|
|
|
|
fi
|
2019-12-16 08:31:49 +01:00
|
|
|
|
2020-09-02 08:59:51 +02:00
|
|
|
script:
|
|
|
|
- |
|
|
|
|
# Only check clippy if stable...
|
|
|
|
if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then
|
|
|
|
cargo clippy -- -D clippy::all
|
|
|
|
fi
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "armv7-unknown-linux-gnueabihf" ]]; then
|
|
|
|
cargo build --verbose --target $TARGET
|
|
|
|
else
|
|
|
|
cargo test --verbose --target $TARGET
|
|
|
|
fi
|
2020-02-18 02:29:41 +01:00
|
|
|
|
2020-02-19 06:06:52 +01:00
|
|
|
before_deploy:
|
2020-02-18 02:29:41 +01:00
|
|
|
- |
|
2020-08-31 23:50:21 +02:00
|
|
|
echo "Test whether installing works. This is mostly just a sanity check.";
|
|
|
|
cargo install --path . --target $TARGET --locked --force;
|
|
|
|
- |
|
|
|
|
echo "Building release..."
|
2020-02-20 07:37:46 +01:00
|
|
|
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Building Windows 64-bit...";
|
2020-02-22 06:41:55 +01:00
|
|
|
cargo build --release --target x86_64-pc-windows-msvc;
|
2020-08-31 23:50:21 +02:00
|
|
|
local target_dir=$(ls target/release/build/bottom-*/out/rg.bash | head -n1 | xargs dirname)
|
|
|
|
cp -r $target_dir completions
|
2020-03-24 04:02:29 +01:00
|
|
|
mv "./target/x86_64-pc-windows-msvc/release/btm" "btm.exe";
|
2020-08-24 01:20:08 +02:00
|
|
|
strip "btm.exe"
|
2020-08-31 23:50:21 +02:00
|
|
|
zip -r bottom_x86_64-pc-windows-msvc.zip "btm.exe" "completions";
|
2020-08-24 01:20:08 +02:00
|
|
|
rm "btm.exe"
|
2020-08-31 23:50:21 +02:00
|
|
|
rm -r "completions"
|
|
|
|
|
|
|
|
echo "Building Windows 32-bit...";
|
|
|
|
cargo clean;
|
2020-02-22 06:41:55 +01:00
|
|
|
cargo build --release --target i686-pc-windows-msvc;
|
2020-08-31 23:50:21 +02:00
|
|
|
local target_dir=$(ls target/release/build/bottom-*/out/rg.bash | head -n1 | xargs dirname)
|
|
|
|
cp -r $target_dir completions
|
2020-03-24 04:02:29 +01:00
|
|
|
mv "./target/i686-pc-windows-msvc/release/btm" "btm.exe";
|
2020-08-24 01:20:08 +02:00
|
|
|
strip "btm.exe"
|
2020-08-31 23:50:21 +02:00
|
|
|
zip -r bottom_i686-pc-windows-msvc.zip "btm.exe" "completions";
|
2020-08-24 01:20:08 +02:00
|
|
|
rm "btm.exe"
|
2020-08-31 23:50:21 +02:00
|
|
|
rm -r "completions"
|
|
|
|
|
|
|
|
echo "Building choco template...";
|
2020-08-23 21:48:06 +02:00
|
|
|
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/";
|
2020-08-24 05:24:06 +02:00
|
|
|
cd "./deployment/windows/choco/"
|
|
|
|
zip -r choco.zip "bottom.nuspec" "tools/";
|
|
|
|
cd "../../../";
|
|
|
|
mv "./deployment/windows/choco/choco.zip" "./choco.zip"
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Building msi file...";
|
2020-08-23 02:22:47 +02:00
|
|
|
cargo install cargo-wix;
|
|
|
|
cargo wix init;
|
2020-08-24 03:22:31 +02:00
|
|
|
cargo wix;
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Building winget template...";
|
|
|
|
python "./deployment/packager.py" $TRAVIS_TAG "./deployment/windows/winget/winget.yaml.template" "$TRAVIS_TAG.yaml" "SHA256" "./bottom_x86_64_installer.msi";
|
|
|
|
|
|
|
|
echo "Done Windows pre-deploy!";
|
2020-02-20 07:37:46 +01:00
|
|
|
else
|
2020-08-31 23:50:21 +02:00
|
|
|
echo "Building release for macOS/Linux...";
|
2020-02-20 07:37:46 +01:00
|
|
|
cargo build --release;
|
|
|
|
cp ./target/release/btm btm;
|
|
|
|
strip btm;
|
2020-08-31 23:50:21 +02:00
|
|
|
local target_dir=$(ls target/release/build/bottom-*/out/rg.bash | head -n1 | xargs dirname)
|
|
|
|
cp -r $target_dir completions
|
2020-09-02 08:59:51 +02:00
|
|
|
echo "Tar-ing macOS/Linux binary and completions..."
|
|
|
|
tar -czvf bottom_$TARGET.tar.gz btm completions;
|
2020-08-31 23:50:21 +02:00
|
|
|
|
2020-02-20 07:37:46 +01:00
|
|
|
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
|
2020-08-31 23:50:21 +02:00
|
|
|
echo "Generating AUR template...";
|
2020-08-24 05:24:06 +02:00
|
|
|
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";
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Generating AUR binary template...";
|
2020-08-24 05:24:06 +02:00
|
|
|
python "./deployment/packager.py" $TRAVIS_TAG "./deployment/linux/arch/PKGBUILD.template" "./PKGBUILD" "SHA512" "./$TRAVIS_TAG.tar.gz";
|
|
|
|
rm "$TRAVIS_TAG.tar.gz";
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Tar-ing AUR PKGBUILDs...";
|
2020-08-19 05:22:50 +02:00
|
|
|
tar -czvf arch.tar.gz PKGBUILD_BIN PKGBUILD;
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
# Note this requires the completions directory in the current directory.
|
|
|
|
echo "Generating Debian install file...";
|
2020-08-19 05:22:50 +02:00
|
|
|
cargo install cargo-deb;
|
|
|
|
cargo deb;
|
|
|
|
cp ./target/debian/bottom_*.deb .;
|
2020-02-20 07:37:46 +01:00
|
|
|
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
|
2020-08-24 05:24:06 +02:00
|
|
|
# The bottom.rb file must be generated AFTER, since it relies on the Linux binary file.
|
2020-02-20 07:37:46 +01:00
|
|
|
fi
|
2020-08-31 23:50:21 +02:00
|
|
|
|
|
|
|
echo "Done macOS/Linux pre-deploy!";
|
2020-02-18 02:29:41 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
provider: releases
|
2020-02-21 06:49:10 +01:00
|
|
|
overwrite: true
|
2020-05-05 02:35:31 +02:00
|
|
|
api_key:
|
2020-02-20 04:59:20 +01:00
|
|
|
secure: ppBn0DnqZ+Rzb84doZQxYdUBQ0rVrZNIiH6ZSFEiCVJd0ttqXfOjK/qXbIf/zabwO0Olqz18jwd9piHjNigWRrHwX9N+YH0DZTM3f4WS2/2acvOP3AjSw6oERjYTwS5yKe/XP1sU11uL6O0oAxYFeiAkn7QOM7flVUE2BmmLAs2lLtQ+9ylmUeBGatrkTfQ0Z2i1o7p5mtI2fKUozpImtHq8TClQEsF4oQS5nvkHtpLuPQ0UrJ8vKZijDBeMuLbDkR121ujRnjoBt8+eXBRbwzAvVotwRozyol8noAN3i4VvYueId6oX7Y2DSEp26wnCuRXGurUnyya5JE55AKoevK+SUHRe5+29/2lPbC5d/etZt2tSX1AIJk9fHeIfRPSTzanIIyDpUzSGoMKjl1ARKGrgHYehRxMKpW0cC2xHSlQ+NrA5apLpXKr2IzpkGsxpAxLqRASbX2VJYCEL70WoJfXinZrxeDxXsaWBLGaj9ySyk059GZBMz9GBdYNtwF3G/3aSIt0nkEGgKipgYXHi5keKKGmyfeZyYkRJRbc369JRZiHuOWct+1ZsOdrKKdbyAdcDGj5kbKuYwA6E+wgI62IWvUTm+vtKDuIbLpu/48aOUuEslGHkYAszLTapX/Le9c9XTu3L+PMgkPq2LSyaeGrfnM+DE/Hwe3Jvurccp94=
|
2020-02-20 05:46:07 +01:00
|
|
|
file_glob: true
|
2020-02-22 06:41:55 +01:00
|
|
|
file:
|
|
|
|
- bottom_*.tar.gz
|
|
|
|
- bottom_*.zip
|
2020-02-23 00:38:18 +01:00
|
|
|
- bottom_*.deb
|
2020-08-19 05:22:50 +02:00
|
|
|
- arch.tar.gz
|
2020-08-23 02:22:47 +02:00
|
|
|
- bottom.rb
|
2020-08-19 05:22:50 +02:00
|
|
|
- choco.zip
|
2020-08-23 02:22:47 +02:00
|
|
|
- bottom_x86_64_installer.msi
|
|
|
|
- $TRAVIS_TAG.yaml
|
2020-05-05 02:35:31 +02:00
|
|
|
skip_cleanup: true
|
2020-02-18 02:29:41 +01:00
|
|
|
on:
|
|
|
|
tags: true
|
2020-02-20 04:59:20 +01:00
|
|
|
condition: "$TRAVIS_RUST_VERSION = stable"
|
2020-02-18 02:29:41 +01:00
|
|
|
repo: ClementTsang/bottom
|
|
|
|
draft: true
|