diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-11-21 15:31:19 -0500 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-11-22 02:33:48 -0500 |
commit | 2d127f198ec7ee0032f4435898c1268dcd09b735 (patch) | |
tree | 077a19d40000b4b46cc20cdc48db65477935ad91 | |
parent | e8238daa641c26651c20f06baeb2bd44690f2f68 (diff) |
ci: uptick to 0.5.1, fix ci
-rw-r--r-- | .cargo/config.toml | 3 | ||||
-rw-r--r-- | .github/pull_request_template.md | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 95 | ||||
-rw-r--r-- | .github/workflows/deployment.yml | 323 | ||||
-rw-r--r-- | .github/workflows/post-deploy.yml (renamed from .github/workflows/deploy.yml) | 25 | ||||
-rw-r--r-- | .travis.yml | 214 | ||||
-rw-r--r-- | .vscode/settings.json | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 10 | ||||
-rw-r--r-- | Cargo.lock | 42 | ||||
-rw-r--r-- | Cargo.toml | 10 | ||||
-rw-r--r-- | README.md | 20 | ||||
-rw-r--r-- | rustfmt.toml | 1 | ||||
-rw-r--r-- | src/app/data_harvester/disks.rs | 7 | ||||
-rw-r--r-- | src/constants.rs | 6 | ||||
-rw-r--r-- | tests/layout_management_tests.rs | 2 | ||||
-rw-r--r-- | tests/layout_movement_tests.rs | 2 |
16 files changed, 455 insertions, 309 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml index 6350f283..e31c6201 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,6 +4,9 @@ rustflags = ["-C", "target-feature=+crt-static"] [target.i686-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] +[target.arm-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + [target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 46d314a4..c9b2e57a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -37,7 +37,7 @@ _If relevant, ensure the following have been met:_ - [ ] _Change has been tested to work, and does not cause new breakage unless intended_ - [ ] _Code has been self-reviewed_ - [ ] _Documentation has been added/updated if needed (README, help menu, etc.)_ -- [ ] _Passes Travis tests (clippy check and `cargo test` check)_ +- [ ] _Passes CI pipeline (clippy check and `cargo test` check)_ - [ ] _Areas your change affects have been linted using rustfmt (`cargo fmt`)_ - [ ] _No merge conflicts arise from the change_ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e61d49ea..9a8dc26a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,14 +3,13 @@ # - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml name: ci + on: workflow_dispatch: pull_request: push: branches: - master - schedule: - - cron: "0 5 * * *" jobs: # Check rustfmt @@ -19,9 +18,9 @@ jobs: strategy: matrix: os: - - ubuntu-latest + - ubuntu-18.04 - macOS-latest - - windows-latest + - windows-2019 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -38,16 +37,17 @@ jobs: strategy: matrix: os: - - ubuntu-latest + - ubuntu-18.04 - macOS-latest - - windows-latest + - windows-2019 steps: - uses: actions/checkout@v2 - - name: Cache cargo build target - uses: actions/cache@v1 - with: - path: target - key: clippy-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} + + # - name: Cache Cargo + # uses: actions/cache@v1 + # with: + # path: target + # key: clippy-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} - uses: actions-rs/toolchain@v1 with: @@ -55,10 +55,11 @@ jobs: toolchain: stable override: true components: clippy + - run: cargo clippy --all-targets --workspace -- -D warnings - # Compile test. - compile: + # Compile/check test. + check: name: ${{ matrix.toolchain }} / ${{ matrix.triple.target }} needs: [rustfmt, clippy] runs-on: ${{ matrix.triple.os }} @@ -68,25 +69,25 @@ jobs: triple: # Standard x86-64 stuff, stable - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "x86_64-unknown-linux-gnu", cross: false, rust: stable, } - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "i686-unknown-linux-gnu", cross: true, rust: stable, } - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "x86_64-unknown-linux-musl", cross: false, rust: stable, } - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "i686-unknown-linux-musl", cross: true, rust: stable, @@ -98,14 +99,25 @@ jobs: rust: stable, } - { - os: "windows-latest", + os: "windows-2019", + target: "i686-pc-windows-msvc", + cross: true, + rust: stable, + } + - { + os: "windows-2019", target: "x86_64-pc-windows-msvc", cross: false, rust: stable, } - - { os: "windows-latest", target: "i686-pc-windows-gnu", cross: true } - { - os: "windows-latest", + os: "windows-2019", + target: "i686-pc-windows-gnu", + cross: true, + rust: stable, + } + - { + os: "windows-2019", target: "x86_64-pc-windows-gnu", cross: false, rust: stable, @@ -113,35 +125,23 @@ jobs: # aarch64 - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "aarch64-unknown-linux-gnu", cross: true, rust: stable, } - - { - os: "ubuntu-latest", - target: "aarch64-unknown-linux-musl", - cross: true, - rust: stable, - } # armv7 - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "armv7-unknown-linux-gnueabihf", cross: true, rust: stable, } - - { - os: "ubuntu-latest", - target: "armv7-unknown-linux-musleabihf", - cross: true, - rust: stable, - } # PowerPC 64 LE - { - os: "ubuntu-latest", + os: "ubuntu-18.04", target: "powerpc64le-unknown-linux-gnu", cross: true, rust: stable, @@ -154,18 +154,19 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: ${{ matrix.toolchain }} + toolchain: ${{ matrix.triple.rust }} override: true + target: ${{ matrix.triple.target }} - name: Check uses: actions-rs/cargo@v1 with: command: check - args: --all-targets --verbose + args: --all-targets --verbose --target=${{ matrix.triple.target }} use-cross: ${{ matrix.triple.cross }} tests: - needs: [compile] + needs: [check] name: Test ${{ matrix.os }} runs-on: ${{ matrix.os }} continue-on-error: true @@ -173,18 +174,16 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + - ubuntu-18.04 - macOS-latest - - windows-latest - toolchain: - - stable + - windows-2019 steps: - uses: actions/checkout@v2 - name: Install toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: ${{ matrix.toolchain }} + toolchain: stable override: true - name: Run tests @@ -192,3 +191,13 @@ jobs: env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true RUST_BACKTRACE: full + + complete: + needs: [tests] + name: CI Pipeline Complete + runs-on: ubuntu-latest + steps: + - name: Echo completion + shell: bash + run: | + echo "Complete!" diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index e69de29b..62d539ba 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -0,0 +1,323 @@ +# Based on: +# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml + +name: deployment + +on: + workflow_dispatch: + create: + tags: + - /^\d+\.\d+(\.\d+)?(-\S*)?$/ + +jobs: + create-github-release: + name: create-github-release + runs-on: ubuntu-latest + steps: + - name: Create artifacts directory + run: mkdir artifacts + + - name: Get the release version from the tag + if: env.VERSION == '' + run: | + echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "version is: ${{ env.VERSION }}" + - name: Create GitHub release + id: release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + draft: true + tag_name: ${{ env.VERSION }} + release_name: ${{ env.VERSION }} Release + + - name: Save release upload URL to artifact + run: echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url + + - name: Save version number to artifact + run: echo "${{ env.VERSION }}" > artifacts/release-version + + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: artifacts + path: artifacts + + build-release: + name: build-release + needs: [create-github-release] + runs-on: ${{ matrix.triple.os }} + env: + RUST_BACKTRACE: 1 + strategy: + fail-fast: false + matrix: + triple: + # Standard x86-64 stuff, stable + - { + os: "ubuntu-18.04", + target: "x86_64-unknown-linux-gnu", + cross: false, + } + - { + os: "ubuntu-18.04", + target: "i686-unknown-linux-gnu", + cross: true, + } + - { + os: "ubuntu-18.04", + target: "x86_64-unknown-linux-musl", + cross: false, + } + - { + os: "ubuntu-18.04", + target: "i686-unknown-linux-musl", + cross: true, + } + - { + os: "macOS-latest", + target: "x86_64-apple-darwin", + cross: false, + } + - { + os: "windows-2019", + target: "x86_64-pc-windows-msvc", + cross: false, + } + - { + os: "windows-2019", + target: "i686-pc-windows-gnu", + cross: true, + } + - { + os: "windows-2019", + target: "x86_64-pc-windows-gnu", + cross: false, + } + + # aarch64 + - { + os: "ubuntu-18.04", + target: "aarch64-unknown-linux-gnu", + cross: true, + } + + # armv7 + - { + os: "ubuntu-18.04", + target: "armv7-unknown-linux-gnueabihf", + cross: true, + } + + # PowerPC 64 LE + - { + os: "ubuntu-18.04", + target: "powerpc64le-unknown-linux-gnu", + cross: true, + } + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v2 + + - name: Get release download URL + uses: actions/download-artifact@v1 + with: + name: artifacts + path: artifacts + + - name: Set release upload URL and release version + shell: bash + run: | + release_upload_url="$(cat artifacts/release-upload-url)" + echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV + echo "release upload url: $RELEASE_UPLOAD_URL" + release_version="$(cat artifacts/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + echo "release version: $RELEASE_VERSION" + + - name: Install Net-Framework-Core (Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + shell: powershell + run: Install-WindowsFeature Net-Framework-Core + + - name: Install wixtoolset (Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + uses: crazy-max/ghaction-chocolatey@v1.4.0 + with: + args: install -y wixtoolset + + # - name: Export wixtoolset to path (Windows x86-64 MSVC) + # if: matrix.triple.target == 'x86_64-pc-windows-msvc' + # shell: powershell + # run: export PATH=${PATH}:"/c/Program Files (x86)/WiX Toolset v3.11/bin"; + + - name: Install zip (Windows) + if: matrix.triple.os == 'windows-2019' + uses: crazy-max/ghaction-chocolatey@v1.4.0 + with: + args: install -y zip + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: ${{ matrix.triple.target }} + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --verbose --target=${{ matrix.triple.target }} + use-cross: ${{ matrix.triple.cross }} + + - name: Bundle autocomplete + shell: bash + run: | + echo $PWD + ls + echo "completion_dir=$(ls ./target/release/build/bottom-*/out/btm.bash | head -n1 | xargs dirname)" >> $GITHUB_ENV + cp -r $completion_dir completion + + - name: Strip release binary (x86-64 or i686) + if: matrix.triple.target != 'aarch64-unknown-linux-gnu' && matrix.triple.target != 'armv7-unknown-linux-gnueabihf' && matrix.triple.target != 'powerpc64le-unknown-linux-gnu' + run: | + strip target/release/btm + + # - name: Strip release binary (aarch64) + # if: matrix.triple.target == 'aarch64-unknown-linux-gnu' + # run: | + # docker run --rm -v \ + # "$PWD/target:/target:Z" \ + # rustembedded/cross:aarch64-unknown-linux-gnu \ + # aarch64-linux-gnu-strip \ + # /target/aarch64-unknown-linux-gnu/release/btm + + # - name: Strip release binary (armv7) + # if: matrix.triple.target == 'armv7-unknown-linux-gnueabihf' + # run: | + # docker run --rm -v \ + # "$PWD/target:/target:Z" \ + # rustembedded/cross:armv7-unknown-linux-gnueabihf \ + # arm-linux-gnueabihf-strip \ + # /target/armv7-unknown-linux-gnueabihf/release/btm + + # - name: Strip release binary (ppc) + # if: matrix.triple.target == 'powerpc64le-unknown-linux-gnu' + # run: | + # docker run --rm -v \ + # "$PWD/target:/target:Z" \ + # rustembedded/cross:powerpc64le-unknown-linux-gnu \ + # powerpc64le-linux-gnu-strip \ + # /target/powerpc64le-unknown-linux-gnu/release/btm + + - name: Bundle release and completion (Windows) + shell: bash + run: | + cp target/release/btm btm.exe; + zip -r bottom_${{ matrix.triple.target }}.zip "btm.exe", "completion" + echo "ASSET=bottom_${{ matrix.triple.target }}.zip" >> $GITHUB_ENV + + - name: Bundle release and completion (Linux and macOS) + shell: bash + run: | + cp target/release/btm ./btm; + tar -czvf bottom_${{ matrix.triple.target }}.tar.gz btm completion; + echo "ASSET=bottom_${{ matrix.triple.target }}.tar.gz" >> $GITHUB_ENV + + - name: Upload main release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.ASSET }} + asset_name: ${{ env.ASSET }} + asset_content_type: application/octet-stream + + - name: Build msi file (only Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + shell: powershell + run: | + cargo install cargo-wix; + cargo wix init; + cargo wix; + + - name: Upload msi file (only Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: bottom_x86_64_installer.msi + asset_name: bottom_x86_64_installer.msi + asset_content_type: application/octet-stream + + - name: Build winget (only Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + run: | + python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/windows/winget/winget.yaml.template" "${{ env.RELEASE_VERSION }}.yaml" "SHA256" "./bottom_x86_64_installer.msi"; + + - name: Upload winget file (only Windows x86-64 MSVC) + if: matrix.triple.target == 'x86_64-pc-windows-msvc' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.RELEASE_VERSION }}.yaml + asset_name: ${{ env.RELEASE_VERSION }}.yaml + asset_content_type: application/octet-stream + + - name: Build Debian release (only Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + run: | + cargo install cargo-deb; + cargo deb; + cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb + + - name: Upload Debian file (only Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: bottom_${{ env.RELEASE_VERSION }}_amd64.deb + asset_name: bottom_${{ env.RELEASE_VERSION }}_amd64.deb + asset_content_type: application/octet-stream + + - name: Build AUR PKGBUILD (only Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + run: | + curl -LO "https://github.com/ClementTsang/bottom/archive/${{ env.RELEASE_VERSION }}.tar.gz"; + python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/linux/arch/PKGBUILD.template" "./PKGBUILD" "SHA512" "./${{ env.target }}.tar.gz"; + + - name: Build AUR binary PKGBUILD (only Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + run: | + python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/linux/arch/PKGBUILD_BIN.template" "./PKGBUILD_BIN" "SHA512" "./bottom_x86_64-unknown-linux-gnu.tar.gz"; + + - name: Tar AUR PKGBUILDs + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + run: | + tar -czvf arch.tar.gz PKGBUILD_BIN PKGBUILD; + + - name: Upload AUR PKGBUILDs (only Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: arch.tar.gz + asset_name: arch.tar.gz + asset_content_type: application/octet-stream diff --git a/.github/workflows/deploy.yml b/.github/workflows/post-deploy.yml index 206d0f19..8147d0b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/post-deploy.yml @@ -5,27 +5,46 @@ on: types: [published] jobs: - deploy: + post-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Test env run: | echo $RELEASE_VERSION + - name: Make sure you're not on master... run: | if [[ $RELEASE_VERSION == "master" ]]; then exit 1 fi + - name: Download packages run: | curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-unknown-linux-gnu.tar.gz"; curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-apple-darwin.tar.gz"; - - name: Execute packaging script + + - name: Execute choco packaging script + run: | + 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/"; + zip -r choco.zip "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/"; + + - name: Upload choco.zip to release + uses: svenstaro/upload-release-action@2.1.0 + with: + repo_token: ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} + file: choco.zip + tag: ${{ env.RELEASE_VERSION }} + overwrite: true + + - name: Execute Homebrew packaging script run: | python "./deployment/packager.py" $RELEASE_VERSION "./deployment/macos/homebrew/bottom.rb.template" "./bottom.rb" "SHA256" "./bottom_x86_64-apple-darwin.tar.gz" "./bottom_x86_64-unknown-linux-gnu.tar.gz"; + - name: Upload bottom.rb to release uses: svenstaro/upload-release-action@2.1.0 with: @@ -33,12 +52,14 @@ jobs: file: bottom.rb tag: ${{ env.RELEASE_VERSION }} overwrite: true + - name: Trigger homebrew run: | curl -X POST https://api.github.com/repos/ClementTsang/homebrew-bottom/dispatches \ -H 'Accept: application/vnd.github.everest-preview+json' \ -u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \ --data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }' + - name: Trigger choco run: | curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01730227..00000000 --- a/.travis.yml +++ /dev/null @@ -1,214 +0,0 @@ -language: rust -notifications: - email: - on_success: never - -matrix: - include: - # Standard x86-64 stuff, stable and beta, on tier-1 environments - - 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 - - # Windows GNU - - os: windows - env: TARGET=x86_64-pc-windows-gnu - arch: amd64 - rust: stable - - # PowerPC 64 LE - - os: linux - env: TARGET=powerpc64le-unknown-linux-gnu - arch: ppc64le - rust: stable - - # 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 - - fast_finish: true - exclude: - - if: tag IS present - rust: beta - -branches: - only: - - master - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ - -cache: cargo - -before_install: - - export RUST_BACKTRACE=1 - - | - if [[ $TRAVIS_OS_NAME == "windows" && -n $TRAVIS_TAG ]]; then - echo "Pre-installing deploy dependencies for Windows..."; - powershell Install-WindowsFeature Net-Framework-Core; - choco install -y wixtoolset; - export PATH=$PATH:"/c/Program Files (x86)/WiX Toolset v3.11/bin"; - choco install zip; - rustup target add i686-pc-windows-msvc; - fi - -before_script: - - rustup target add $TARGET - - rustup update - - | - # Only check clippy if stable... - if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then - rustup component add clippy - fi - -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_HUSKY_DONT_INSTALL_HOOKS=true cargo test --verbose --target $TARGET - fi - -before_deploy: - - | - echo "Test whether installing works. This is mostly just a sanity check."; - cargo install --path . --target $TARGET --locked --force; - - | - echo "Building release..." - if [[ $TRAVIS_OS_NAME == "windows" ]]; then - echo "Building Windows 64-bit, target: $TARGET..."; - cargo build --release --target $TARGET; - local target_dir=$(ls target/release/build/bottom-*/out/btm.bash | head -n1 | xargs dirname) - cp -r $target_dir completions - mv "./target/$TARGET/release/btm" "btm.exe"; - strip "btm.exe" - zip -r bottom_$TARGET.zip "btm.exe" "completions"; - rm "btm.exe" - rm -r "completions" - - if [[ $TARGET == "x86_64-pc-windows-msvc" ]]; then - echo "Building further results for x86_64-pc-windows-msvc target..." - echo "Building Windows 32-bit..."; - cargo clean; - cargo build --release --target i686-pc-windows-msvc; - local target_dir=$(ls target/release/build/bottom-*/out/btm.bash | head -n1 | xargs dirname) - cp -r $target_dir completions - mv "./target/i686-pc-windows-msvc/release/btm" "btm.exe"; - strip "btm.exe" - zip -r bottom_i686-pc-windows-msvc.zip "btm.exe" "completions"; - rm "btm.exe" - rm -r "completions" - - echo "Building choco template..."; - 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" - - echo "Building msi file..."; - cargo install cargo-wix; - cargo wix init; - cargo wix; - - 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"; - fi - - echo "Done Windows pre-deploy!"; - else - echo "Building release for macOS/Linux, target: $TARGET"; - cargo build --release; - cp ./target/release/btm btm; - strip btm; - local target_dir=$(ls target/release/build/bottom-*/out/btm.bash | head -n1 | xargs dirname) - cp -r $target_dir completions - echo "Tar-ing macOS/Linux binary and completions..." - tar -czvf bottom_$TARGET.tar.gz btm completions; - - if [[ $TRAVIS_OS_NAME == "linux" && $TARGET == "x86_64-unknown-linux-gnu" ]]; then - echo "Building further results for x86_64-unknown-linux-gnu..." - echo "Generating AUR template..."; - 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"; - - echo "Generating AUR binary template..."; - python "./deployment/packager.py" $TRAVIS_TAG "./deployment/linux/arch/PKGBUILD.template" "./PKGBUILD" "SHA512" "./$TRAVIS_TAG.tar.gz"; - rm "$TRAVIS_TAG.tar.gz"; - - echo "Tar-ing AUR PKGBUILDs..."; - tar -czvf arch.tar.gz PKGBUILD_BIN PKGBUILD; - - # Note this requires the completions directory in the current directory. - echo "Generating Debian install file..."; - cargo install cargo-deb; - cargo deb; - cp ./target/debian/bottom_*.deb .; - fi - - echo "Done macOS/Linux pre-deploy!"; - 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 diff --git a/.vscode/settings.json b/.vscode/settings.json index accd5163..1b7f47ed 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -48,6 +48,7 @@ "cvars", "czvf", "denylist", + "dont", "eselect", "fedoracentos", "fpath", @@ -68,6 +69,7 @@ "memb", "minwindef", "musl", + "musleabihf", "n'th", "nixos", "noheader", diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d754db7..6222a877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.5.1] - Unreleased +## [0.5.1] - 2020-11-22 -### Features +## Bug Fixes -### Changes +- [6ef1d66](https://github.com/ClementTsang/bottom/commit/6ef1d66b2bca49452572a2cabb87d338dcf56e7b): Remove nord as a valid colour for now. + +- [e04ce4f](https://github.com/ClementTsang/bottom/commit/e04ce4fa1b42e99f00cf8825bcd58da43552214e): Fix `--use_old_network_legend`. + +- [99d0402](https://github.com/ClementTsang/bottom/commit/99d04029f0ebfc73d36adb06ea58ad68f090017c): Fix config detection for built-in colours. |