diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2022-05-28 16:14:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-28 16:14:25 -0400 |
commit | 96d5b9b87d5b769be6b2fb0c0c732fcbd3175037 (patch) | |
tree | b6ecf2e9e54fa537146b6c30b76b8f869cd5eaa2 | |
parent | 42909dba3573dd1cdd30d986c3227e0996edb7b0 (diff) |
deployment: add aarch64/armv7 gnu .deb generation (#739)
Adds .deb generation for aarch64 and armv7 gnu targets in the nightly and deploy workflows.
-rw-r--r-- | .github/workflows/deployment.yml | 56 | ||||
-rw-r--r-- | .github/workflows/nightly.yml | 56 | ||||
-rw-r--r-- | Cargo.toml | 8 | ||||
-rw-r--r-- | Cross.toml | 2 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | build.rs | 4 |
6 files changed, 98 insertions, 40 deletions
diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 02670e55..6906f15c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -54,6 +54,7 @@ jobs: container: ${{ matrix.triple.container }} env: RUST_BACKTRACE: 1 + BTM_GENERATE: true strategy: fail-fast: false matrix: @@ -162,11 +163,6 @@ jobs: args: --release --verbose --locked --target=${{ matrix.triple.target }} --features deploy use-cross: ${{ matrix.triple.cross }} - - name: Build autocompletion and manpage - shell: bash - run: | - GENERATE=true cargo build - - name: Bundle release and completion (Windows) if: matrix.triple.os == 'windows-2019' shell: bash @@ -287,8 +283,26 @@ jobs: name: build-deb needs: [initialize-release-job] runs-on: "ubuntu-18.04" + strategy: + fail-fast: false + matrix: + tuple: + - { target: "x86_64-unknown-linux-gnu", cross: false, dpkg: amd64 } + - { + target: "aarch64-unknown-linux-gnu", + cross: true, + dpkg: arm64, + container: "ghcr.io/clementtsang/cargo-deb-aarch64-unknown-linux-gnu", + } + - { + target: "armv7-unknown-linux-gnueabihf", + cross: true, + dpkg: armhf, + container: "ghcr.io/clementtsang/cargo-deb-armv7-unknown-linux-gnueabihf", + } env: RUST_BACKTRACE: 1 + BTM_GENERATE: true steps: - name: Checkout repository uses: actions/checkout@v2 @@ -317,38 +331,46 @@ jobs: profile: minimal toolchain: stable override: true - target: x86_64-unknown-linux-gnu + target: ${{ matrix.tuple.target }} - uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 - with: - key: x86_64-unknown-linux-gnu-deb - name: Build uses: actions-rs/cargo@v1 with: command: build - args: --release --locked --verbose --features deploy + args: --release --locked --verbose --features deploy --target ${{ matrix.tuple.target }} + use-cross: ${{ matrix.tuple.cross }} - - name: Build autocompletion and manpage + - name: Zip manpage shell: bash run: | - GENERATE=true cargo build gzip ./manpage/btm.1 - - name: Build Debian release + - name: Build Debian release (x86-64) + if: matrix.tuple.cross == false + run: | + cargo install cargo-deb --version 1.38.0 --locked + cargo deb --no-build --target ${{ matrix.tuple.target }} + cp ./target/${{ matrix.tuple.target }}/debian/bottom_*.deb ./bottom_${{ matrix.tuple.target }}.deb + + - name: Build Debian release (ARM) + if: matrix.tuple.cross == true run: | - cargo install cargo-deb --version 1.37.0 --locked - cargo deb --no-build - cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb + docker pull ${{ matrix.tuple.container }} + docker run -t --rm --mount type=bind,source="$(pwd)",target=/volume ${{ matrix.tuple.container }} "--variant ${{ matrix.tuple.dpkg }} --target ${{ matrix.tuple.target }} --no-build" "/volume" + cp ./target/${{ matrix.tuple.target }}/debian/bottom-*.deb ./bottom_${{ matrix.tuple.target }}.deb - name: Test Debian release - run: sudo dpkg -i ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb + run: | + dpkg -I ./bottom_${{ matrix.tuple.target }}.deb + dpkg -I ./bottom_${{ matrix.tuple.target }}.deb | grep ${{ matrix.tuple.dpkg }} && echo "Found correct architecture" - name: Create release directory for artifact, move file shell: bash run: | mkdir release - mv bottom_${{ env.RELEASE_VERSION }}_amd64.deb release/ + mv bottom_${{ matrix.tuple.target }}.deb release/ - name: Save release as artifact uses: actions/upload-artifact@v2 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 37b26cae..fdbf1ce4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -50,6 +50,7 @@ jobs: container: ${{ matrix.triple.container }} env: RUST_BACKTRACE: 1 + BTM_GENERATE: true strategy: fail-fast: false matrix: @@ -158,11 +159,6 @@ jobs: args: --release --locked --verbose --target=${{ matrix.triple.target }} --features deploy use-cross: ${{ matrix.triple.cross }} - - name: Build autocompletion and manpage - shell: bash - run: | - GENERATE=true cargo build - - name: Bundle release and completion (Windows) if: matrix.triple.os == 'windows-2019' shell: bash @@ -281,8 +277,26 @@ jobs: name: build-deb needs: [initialize-job] runs-on: "ubuntu-18.04" + strategy: + fail-fast: false + matrix: + tuple: + - { target: "x86_64-unknown-linux-gnu", cross: false, dpkg: amd64 } + - { + target: "aarch64-unknown-linux-gnu", + cross: true, + dpkg: arm64, + container: "ghcr.io/clementtsang/cargo-deb-aarch64-unknown-linux-gnu", + } + - { + target: "armv7-unknown-linux-gnueabihf", + cross: true, + dpkg: armhf, + container: "ghcr.io/clementtsang/cargo-deb-armv7-unknown-linux-gnueabihf", + } env: RUST_BACKTRACE: 1 + BTM_GENERATE: true steps: - name: Checkout repository uses: actions/checkout@v2 @@ -311,38 +325,46 @@ jobs: profile: minimal toolchain: stable override: true - target: x86_64-unknown-linux-gnu + target: ${{ matrix.tuple.target }} - uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 - with: - key: x86_64-unknown-linux-gnu-deb - name: Build uses: actions-rs/cargo@v1 with: command: build - args: --release --locked --verbose --features deploy + args: --release --locked --verbose --features deploy --target ${{ matrix.tuple.target }} + use-cross: ${{ matrix.tuple.cross }} - - name: Build autocompletion and manpage + - name: Zip manpage shell: bash run: | - GENERATE=true cargo build gzip ./manpage/btm.1 - - name: Build Debian release + - name: Build Debian release (x86-64) + if: matrix.tuple.cross == false + run: | + cargo install cargo-deb --version 1.38.0 --locked + cargo deb --no-build --target ${{ matrix.tuple.target }} + cp ./target/${{ matrix.tuple.target }}/debian/bottom_*.deb ./bottom_${{ matrix.tuple.target }}.deb + + - name: Build Debian release (ARM) + if: matrix.tuple.cross == true run: | - cargo install cargo-deb --version 1.37.0 --locked - cargo deb --no-build - cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb + docker pull ${{ matrix.tuple.container }} + docker run -t --rm --mount type=bind,source="$(pwd)",target=/volume ${{ matrix.tuple.container }} "--variant ${{ matrix.tuple.dpkg }} --target ${{ matrix.tuple.target }} --no-build" "/volume" + cp ./target/${{ matrix.tuple.target }}/debian/bottom-*.deb ./bottom_${{ matrix.tuple.target }}.deb - name: Test Debian release - run: sudo dpkg -i ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb + run: | + dpkg -I ./bottom_${{ matrix.tuple.target }}.deb + dpkg -I ./bottom_${{ matrix.tuple.target }}.deb | grep ${{ matrix.tuple.dpkg }} && echo "Found correct architecture" - name: Create release directory for artifact, move file shell: bash run: | mkdir release - mv bottom_${{ env.RELEASE_VERSION }}_amd64.deb release/ + mv bottom_${{ matrix.tuple.target }}.deb release/ - name: Save Debian file as artifacts uses: actions/upload-artifact@v2 @@ -115,10 +115,16 @@ extended-description = """\ A customizable cross-platform graphical process/system monitor for the terminal. Supports Linux, macOS, and Windows. By default, bottom will look for a config file in ~/.config/bottom/bottom.toml. -If one is not specified it will fall back to defaults. If a config file does not +If one is not specified it will fall back to defaults. If a config file does not exist at the specified or default location, a blank one will be created for the user. """ +[package.metadata.deb.variants.arm64] +depends = "libc6:arm64 (>= 2.28)" + +[package.metadata.deb.variants.armhf] +depends = "libc6:armhf (>= 2.28)" + [package.metadata.wix] output = "bottom_x86_64_installer.msi" diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..f6e8648d --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[build.env] +passthrough = ["RUST_BACKTRACE", "BTM_GENERATE"] @@ -27,7 +27,7 @@ - [Installation](#installation) - [Cargo](#cargo) - [Arch Linux](#arch-linux) - - [Debian/Ubuntu (x86-64)](#debianubuntu-x86-64) + - [Debian/Ubuntu](#debianubuntu) - [Snap](#snap) - [Fedora/CentOS](#fedoracentos) - [Gentoo](#gentoo) @@ -126,15 +126,21 @@ There is an official package that can be installed with `pacman`: sudo pacman -Syu bottom ``` -### Debian/Ubuntu (x86-64) +### Debian/Ubuntu -A `.deb` file is provided on each [release](https://github.com/ClementTsang/bottom/releases/latest): +<!-- FIXME: Update this when bumping version, as the format has changed. --> + +A `.deb` file is provided on each [release](https://github.com/ClementTsang/bottom/releases/latest) (currently only for x86-64): ```bash curl -LO https://github.com/ClementTsang/bottom/releases/download/0.6.8/bottom_0.6.8_amd64.deb sudo dpkg -i bottom_0.6.8_amd64.deb ``` +For ARM (aarch64 and armv7), for now, releases are currently only provided on +[nightly builds](https://github.com/ClementTsang/bottom/releases/tag/nightly), but will be provided alongside the +x86-64 builds in future releases. + ### Snap bottom is available as a [snap](https://snapcraft.io/install/bottom/ubuntu): @@ -23,7 +23,7 @@ fn create_dir(dir: &Path) -> Result<()> { } fn main() -> Result<()> { - if env::var_os("GENERATE").is_some() { + if env::var_os("BTM_GENERATE").is_some() { // OUT_DIR is where extra build files are written to for Cargo. let completion_out_dir = PathBuf::from("completion"); let manpage_out_dir = PathBuf::from("manpage"); @@ -49,7 +49,7 @@ fn main() -> Result<()> { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=./src/clap.rs"); - println!("cargo:rerun-if-env-changed=GENERATE"); + println!("cargo:rerun-if-env-changed=BTM_GENERATE"); Ok(()) } |