summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2021-09-26 00:58:18 -0400
committerClementTsang <cjhtsang@uwaterloo.ca>2021-09-26 00:58:18 -0400
commitb6ca3e0a2274a49b512e8332cb107f8419c9d993 (patch)
treec4a43d2cfb0e4c8f3c8860d4cd0ca676146bf455
parent5c87974fb7f70c728770ff0787cf74b9e00012bf (diff)
parent96ca024accbcb689c271979ac3883a3fe5b72f44 (diff)
other: fix merge conflicts
-rw-r--r--.all-contributorsrc18
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md5
-rw-r--r--.github/workflows/audit.yml2
-rw-r--r--.github/workflows/ci.yml42
-rw-r--r--.github/workflows/deployment.yml221
-rw-r--r--.github/workflows/docs.yml6
-rw-r--r--.github/workflows/nightly.yml188
-rw-r--r--.github/workflows/post-release.yml17
-rw-r--r--CHANGELOG.md9
-rw-r--r--Cargo.lock462
-rw-r--r--Cargo.toml18
-rw-r--r--README.md39
-rw-r--r--docs/content/configuration/config-file/layout.md2
-rw-r--r--docs/content/index.md2
-rw-r--r--docs/content/support.md12
-rw-r--r--docs/content/usage/widgets/battery.md4
-rw-r--r--docs/mkdocs.yml1
-rw-r--r--src/app/data_farmer.rs22
-rw-r--r--src/app/data_harvester.rs36
-rw-r--r--src/app/data_harvester/network/sysinfo.rs2
-rw-r--r--src/app/layout_manager.rs36
-rw-r--r--src/app/states.rs940
-rw-r--r--src/canvas/widgets/mem_graph.rs249
-rw-r--r--src/canvas/widgets/network_graph.rs770
-rw-r--r--src/canvas/widgets/process_table.rs911
-rw-r--r--src/clap.rs132
-rw-r--r--src/data_conversion.rs1
27 files changed, 3648 insertions, 499 deletions
diff --git a/.all-contributorsrc b/.all-contributorsrc
index c005e122..910ff18c 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -189,6 +189,24 @@
"doc",
"platform"
]
+ },
+ {
+ "login": "adiabatic",
+ "name": "adiabatic",
+ "avatar_url": "https://avatars.githubusercontent.com/u/101246?v=4",
+ "profile": "https://www.frogorbits.com/",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "bowlofeggs",
+ "name": "Randy Barlow",
+ "avatar_url": "https://avatars.githubusercontent.com/u/354506?v=4",
+ "profile": "https://electronsweatshop.com",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 433b45db..d4e0d84e 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -6,7 +6,7 @@ labels: "bug"
assignees: ""
---
-Before you report, please take a look at [Troubleshooting](https://clementtsang.github.io/bottom/nightly/troubleshooting) to see if there's already an answer to your problem. Also check out [existing issues](https://github.com/ClementTsang/bottom/issues) and [known problems](https://clementtsang.github.io/bottom/nightly/support/#known-problems) to see if your problem is already reported/known.
+Before you report, please take a look at [Troubleshooting](https://clementtsang.github.io/bottom/nightly/troubleshooting) to see if there's already an answer to your problem. Also check out [existing issues](https://github.com/ClementTsang/bottom/issues) and [known problems](https://clementtsang.github.io/bottom/nightly/support/#known-problems) to see if your problem is already reported/known/fixed.
Also, **please fill in all fields if possible** - if the issue is too hard to reproduce or vague, it may not be fixed!
@@ -24,8 +24,7 @@ Please mention what terminal/terminal emulator you are using `bottom` on (ex: Ko
## What version are you on?
-Please ensure that the bug still exists on the [latest stable release](https://github.com/ClementTsang/bottom/releases/latest) or newer (i.e. nightly). If so, mention
-what version you are using here.
+Please mention which version of bottom you're running (`btm -V`, nightly, etc.)!
## How did you install `bottom`?
diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml
index c70303c2..fa597646 100644
--- a/.github/workflows/audit.yml
+++ b/.github/workflows/audit.yml
@@ -1,7 +1,7 @@
name: audit
on:
schedule:
- - cron: "0 0 * * *"
+ - cron: "0 0 * * 1"
jobs:
audit:
runs-on: ubuntu-latest
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 46f28cda..9c12e669 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,21 +10,20 @@ on:
workflow_dispatch:
pull_request:
paths-ignore:
- - 'README.md'
- - 'docs/**'
- - '.github/ISSUE_TEMPLATE/**'
+ - "README.md"
+ - "docs/**"
+ - ".github/ISSUE_TEMPLATE/**"
push:
branches:
- master
paths-ignore:
- - 'README.md'
- - 'docs/**'
- - '.github/ISSUE_TEMPLATE/**'
- - 'CHANGELOG.md'
- - 'CONTRIBUTING.md'
+ - "README.md"
+ - "docs/**"
+ - ".github/ISSUE_TEMPLATE/**"
+ - "CHANGELOG.md"
+ - "CONTRIBUTING.md"
jobs:
- # Check rustfmt
rustfmt:
runs-on: ${{ matrix.os }}
strategy:
@@ -44,10 +43,9 @@ jobs:
components: rustfmt
- uses: Swatinem/rust-cache@v1
-
+
- run: cargo fmt --all -- --check
- # Check clippy. Note that this doesn't check ARM.
clippy:
runs-on: ${{ matrix.os }}
strategy:
@@ -69,8 +67,6 @@ jobs:
- uses: Swatinem/rust-cache@v1
- # TODO: Can probably put cache here in the future; I'm worried if this will cause issues with clippy though since cargo check breaks it; maybe wait until 1.52, when fix lands.
-
- run: cargo clippy --all-targets --workspace -- -D warnings
# Compile/check/test.
@@ -174,6 +170,14 @@ jobs:
rust: stable,
}
+ # Risc-V 64gc
+ - {
+ os: "ubuntu-latest",
+ target: "riscv64gc-unknown-linux-gnu",
+ cross: true,
+ rust: stable,
+ }
+
# macOS ARM
- {
os: "macOS-latest",
@@ -194,12 +198,22 @@ jobs:
target: ${{ matrix.triple.target }}
- uses: Swatinem/rust-cache@v1
+ with:
+ key: ${{ matrix.triple.target }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
- args: --all-targets --verbose --target=${{ matrix.triple.target }} --no-default-features
+ args: --all-targets --verbose --target=${{ matrix.triple.target }} --features "battery"
+ use-cross: ${{ matrix.triple.cross }}
+
+ - name: Check without battery feature on the main 3
+ if: matrix.triple.toTest == 'true'
+ uses: actions-rs/cargo@v1
+ with:
+ command: check
+ args: --all-targets --verbose --target=${{ matrix.triple.target }}
use-cross: ${{ matrix.triple.cross }}
- name: Run tests
diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml
index 189041c8..3cf29c6a 100644
--- a/.github/workflows/deployment.yml
+++ b/.github/workflows/deployment.yml
@@ -1,4 +1,4 @@
-# How we deploy a release. Covers binary builds. Also manages packaging for winget, choco, and homebrew.
+# How we deploy a release. Covers binary builds. Also manages packaging for winget and choco.
#
# Based on https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
@@ -75,6 +75,7 @@ jobs:
target: "x86_64-unknown-linux-gnu",
cross: false,
artifact: true,
+ strip: true,
}
- {
os: "ubuntu-18.04",
@@ -82,31 +83,46 @@ jobs:
cross: false,
container: quay.io/pypa/manylinux2014_x86_64,
suffix: "2-17",
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "i686-unknown-linux-gnu",
cross: true,
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "x86_64-unknown-linux-musl",
cross: false,
- artifact: true
+ artifact: true,
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "i686-unknown-linux-musl",
cross: true,
+ strip: true,
+ }
+ - {
+ os: "macOS-latest",
+ target: "x86_64-apple-darwin",
+ cross: false,
+ artifact: true,
+ strip: true,
}
- - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false, artifact: true }
- {
os: "windows-2019",
target: "x86_64-pc-windows-msvc",
cross: false,
artifact: true,
}
- - { os: "windows-2019", target: "i686-pc-windows-msvc", cross: false, artifact: true }
+ - {
+ os: "windows-2019",
+ target: "i686-pc-windows-msvc",
+ cross: false,
+ artifact: true,
+ }
- {
os: "windows-2019",
target: "x86_64-pc-windows-gnu",
@@ -118,7 +134,7 @@ jobs:
os: "ubuntu-18.04",
target: "aarch64-unknown-linux-gnu",
cross: true,
- artifact: true
+ artifact: true,
}
# armv7
@@ -126,7 +142,7 @@ jobs:
os: "ubuntu-18.04",
target: "armv7-unknown-linux-gnueabihf",
cross: true,
- artifact: true
+ artifact: true,
}
# PowerPC 64 LE
@@ -136,14 +152,19 @@ jobs:
cross: true,
}
+ # Risc-V 64gc
+ - {
+ os: "ubuntu-18.04",
+ target: "riscv64gc-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@v2
with:
@@ -163,22 +184,6 @@ jobs:
echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
echo "Release version: ${{ env.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 toolchain
uses: actions-rs/toolchain@v1
with:
@@ -188,21 +193,24 @@ jobs:
target: ${{ matrix.triple.target }}
- uses: Swatinem/rust-cache@v1
+ with:
+ key: ${{ matrix.triple.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- args: --release --verbose --target=${{ matrix.triple.target }} --no-default-features
+ args: --release --verbose --target=${{ matrix.triple.target }} --features "battery"
use-cross: ${{ matrix.triple.cross }}
- name: Move autocomplete to working directory
shell: bash
run: |
- cp -r ./target/${{ matrix.triple.target }}/release/build/bottom-*/out completion
+ mkdir completion
+ cp -r ./target/${{ matrix.triple.target }}/release/build/bottom-*/out/. completion
- name: Strip release binary (macOS or Linux x86-64/i686)
- if: matrix.triple.os != 'windows-2019' && matrix.triple.target != 'aarch64-unknown-linux-gnu' && matrix.triple.target != 'armv7-unknown-linux-gnueabihf' && matrix.triple.target != 'powerpc64le-unknown-linux-gnu'
+ if: matrix.triple.strip == true
run: |
strip target/${{ matrix.triple.target }}/release/btm
@@ -246,16 +254,85 @@ jobs:
name: artifacts
path: artifacts
- - name: Build msi file (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc'
+ - name: Compress completion files (Linux x86-64 GNU)
+ if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
+ shell: bash
+ run: |
+ tar -C ./completion -czvf completion.tar.gz .
+
+ - name: Release completion files (Linux x86-64 GNU)
+ if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
+ uses: actions/upload-release-asset@v1.0.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ env.RELEASE_UPLOAD_URL }}
+ asset_path: completion.tar.gz
+ asset_name: completion.tar.gz
+ asset_content_type: application/octet-stream
+
+ build-msi:
+ name: build-msi
+ needs: [create-github-release]
+ runs-on: "windows-2019"
+ env:
+ RUST_BACKTRACE: 1
+ 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@v2
+ 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
+ release_version="$(cat ./artifacts/release-version)"
+ echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
+
+ - name: Validate release environment variables
+ run: |
+ echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
+ echo "Release version: ${{ env.RELEASE_VERSION }}"
+
+ - name: Install Net-Framework-Core (Windows x86-64 MSVC)
+ shell: powershell
+ run: Install-WindowsFeature Net-Framework-Core
+
+ - name: Install wixtoolset (Windows x86-64 MSVC)
+ uses: crazy-max/ghaction-chocolatey@v1.4.0
+ with:
+ args: install -y wixtoolset
+
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ target: x86_64-pc-windows-msvc
+
+ - uses: Swatinem/rust-cache@v1
+ with:
+ key: x86_64-pc-windows-msvc-msi
+
+ - name: Build msi file
shell: powershell
run: |
cargo install cargo-wix --version 0.3.1 --locked
cargo wix init
cargo wix
- - name: Upload msi file (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc'
+ - name: Upload msi file
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -265,15 +342,13 @@ jobs:
asset_name: bottom_x86_64_installer.msi
asset_content_type: application/octet-stream
- - name: Build winget (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc'
+ - name: Build winget
run: |
python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/windows/winget/winget.yaml.template" "Clement.bottom.yaml" "SHA256" "./bottom_x86_64_installer.msi"
$Code = powershell ./deployment/windows/winget/get_product_code.ps1 ./bottom_x86_64_installer.msi
python "./deployment/windows/winget/product_code.py" Clement.bottom.yaml $Code
- - name: Upload winget file (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc'
+ - name: Upload winget file
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -283,15 +358,56 @@ jobs:
asset_name: Clement.bottom.yaml
asset_content_type: application/octet-stream
+ build-deb:
+ name: build-deb
+ needs: [create-github-release]
+ runs-on: "ubuntu-18.04"
+ env:
+ RUST_BACKTRACE: 1
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Get release download URL
+ uses: actions/download-artifact@v2
+ 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
+ release_version="$(cat ./artifacts/release-version)"
+ echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
+
+ - name: Validate release environment variables
+ run: |
+ echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
+ echo "Release version: ${{ env.RELEASE_VERSION }}"
+
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ target: x86_64-unknown-linux-gnu
+
+ - uses: Swatinem/rust-cache@v1
+ with:
+ key: x86_64-unknown-linux-gnu-deb
+
- name: Build Debian release (Linux x86-64 GNU)
- if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
run: |
cargo install cargo-deb --version 1.29.0 --locked
cargo deb
cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb
- name: Upload Debian file (Linux x86-64 GNU)
- if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -346,34 +462,3 @@ jobs:
asset_path: choco.zip
asset_name: choco.zip
asset_content_type: application/octet-stream
-
- - name: Execute Homebrew packaging script
- run: |
- python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/macos/homebrew/bottom.rb.template" "./bottom.rb" "SHA256" "./artifacts/bottom_x86_64-apple-darwin.tar.gz" "./artifacts/bottom_x86_64-unknown-linux-musl.tar.gz";
-
- - name: Upload bottom.rb to release
- uses: actions/upload-release-asset@v1.0.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ env.RELEASE_UPLOAD_URL }}
- asset_path: bottom.rb
- asset_name: bottom.rb
- asset_content_type: application/octet-stream
-
- - name: Compress completion files (Linux x86-64 GNU)
- if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
- shell: bash
- run: |
- tar -C ./completion -czvf completion.tar.gz .
-
- - name: Release completion files (Linux x86-64 GNU)
- if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
- uses: actions/upload-release-asset@v1.0.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ env.RELEASE_UPLOAD_URL }}
- asset_path: completion.tar.gz
- asset_name: completion.tar.gz
- asset_content_type: application/octet-stream
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index c428ebef..eeaaf405 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -26,11 +26,11 @@ jobs:
with:
python-version: 3.x
- - run: pip install mkdocs-material
+ - run: pip install mkdocs-material==7.2.6
- - run: pip install mdx_truly_sane_lists
+ - run: pip install mdx_truly_sane_lists==1.2
- - run: pip install mike
+ - run: pip install mike==1.1.0
- name: Configure git user and email
run: |
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 4c13af32..1a012253 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -1,5 +1,5 @@
# Creates nightly deployment builds for main targets. Note this does not cover package distribution channels,
-# such as choco, Homebrew, etc.
+# such as choco.
name: nightly
@@ -84,6 +84,7 @@ jobs:
os: "ubuntu-18.04",
target: "x86_64-unknown-linux-gnu",
cross: false,
+ strip: true,
}
- {
os: "ubuntu-18.04",
@@ -91,23 +92,32 @@ jobs:
cross: false,
container: quay.io/pypa/manylinux2014_x86_64,
suffix: "2-17",
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "i686-unknown-linux-gnu",
cross: true,
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "x86_64-unknown-linux-musl",
cross: false,
+ strip: true,
}
- {
os: "ubuntu-18.04",
target: "i686-unknown-linux-musl",
cross: true,
+ strip: true,
+ }
+ - {
+ os: "macOS-latest",
+ target: "x86_64-apple-darwin",
+ cross: false,
+ strip: true,
}
- - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false }
- {
os: "windows-2019",
target: "x86_64-pc-windows-msvc",
@@ -141,14 +151,19 @@ jobs:
cross: true,
}
+ # Risc-V 64gc
+ - {
+ os: "ubuntu-18.04",
+ target: "riscv64gc-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@v2
with:
@@ -168,17 +183,6 @@ jobs:
echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
echo "Release version: ${{ env.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: Install toolchain
uses: actions-rs/toolchain@v1
with:
@@ -188,21 +192,24 @@ jobs:
target: ${{ matrix.triple.target }}
- uses: Swatinem/rust-cache@v1
+ with:
+ key: ${{ matrix.triple.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- args: --release --verbose --target=${{ matrix.triple.target }} --no-default-features
+ args: --release --verbose --target=${{ matrix.triple.target }} --features "battery"
use-cross: ${{ matrix.triple.cross }}
- name: Move autocomplete to working directory
shell: bash
run: |
- cp -r ./target/${{ matrix.triple.target }}/release/build/bottom-*/out completion
+ mkdir completion
+ cp -r ./target/${{ matrix.triple.target }}/release/build/bottom-*/out/. completion
- name: Strip release binary (macOS or Linux x86-64/i686)
- if: matrix.triple.os != 'windows-2019' && matrix.triple.target != 'aarch64-unknown-linux-gnu' && matrix.triple.target != 'armv7-unknown-linux-gnueabihf' && matrix.triple.target != 'powerpc64le-unknown-linux-gnu'
+ if: matrix.triple.strip == true
run: |
strip target/${{ matrix.triple.target }}/release/btm
@@ -225,8 +232,6 @@ jobs:
tar -czvf bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz btm completion
echo "ASSET=bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz" >> $GITHUB_ENV
- # TODO: Move this elsewhere; do this all at once, and do not continue if any fails. Store artifacts. Do the same for deployment.
-
- name: Upload main release
if: github.event.inputs.isMock != 'mock'
uses: actions/upload-release-asset@v1.0.1
@@ -239,16 +244,84 @@ jobs:
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
- - name: Build msi file (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc'
+ - name: Compress completion files (Linux x86-64 GNU)
+ if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
+ shell: bash
+ run: |
+ tar -C ./completion -czvf completion.tar.gz .
+
+ - name: Release completion files (Linux x86-64 GNU)
+ if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock != 'mock'
+ uses: actions/upload-release-asset@v1.0.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ env.RELEASE_UPLOAD_URL }}
+ asset_path: completion.tar.gz
+ asset_name: completion.tar.gz
+ asset_content_type: application/octet-stream
+
+ build-msi:
+ name: build-msi
+ needs: [create-github-release]
+ runs-on: "windows-2019"
+ env:
+ RUST_BACKTRACE: 1
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Get release download URL
+ uses: actions/download-artifact@v2
+ 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
+ release_version="$(cat ./artifacts/release-version)"
+ echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
+
+ - name: Validate release environment variables
+ run: |
+ echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
+ echo "Release version: ${{ env.RELEASE_VERSION }}"
+
+ - name: Install Net-Framework-Core
+ shell: powershell
+ run: Install-WindowsFeature Net-Framework-Core
+
+ - name: Install wixtoolset
+ uses: crazy-max/ghaction-chocolatey@v1.4.0
+ with:
+ args: install -y wixtoolset
+
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ target: x86_64-pc-windows-msvc
+
+ - uses: Swatinem/rust-cache@v1
+ with:
+ key: x86_64-pc-windows-msvc-msi
+
+ - name: Build msi file
shell: powershell
run: |
cargo install cargo-wix --version 0.3.1 --locked
cargo wix init
cargo wix
- - name: Upload msi file (Windows x86-64 MSVC)
- if: matrix.triple.target == 'x86_64-pc-windows-msvc' && github.event.inputs.isMock != 'mock'
+ - name: Upload msi file
+ if: github.event.inputs.isMock != 'mock'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -258,15 +331,57 @@ jobs:
asset_name: bottom_x86_64_installer.msi
asset_content_type: application/octet-stream
- - name: Build Debian release (Linux x86-64 GNU)
- if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == ''
+ build-deb:
+ name: build-deb
+ needs: [create-github-release]
+ runs-on: "ubuntu-18.04"
+ env:
+ RUST_BACKTRACE: 1
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Get release download URL
+ uses: actions/download-artifact@v2
+ 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
+ release_version="$(cat ./artifacts/release-version)"
+ echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
+
+ - name: Validate release environment variables
+ run: |
+ echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
+ echo "Release version: ${{ env.RELEASE_VERSION }}"
+
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ target: x86_64-unknown-linux-gnu
+
+ - uses: Swatinem/rust-cache@v1
+ with:
+ k