deployment: add aarch64/armv7 gnu .deb generation (#739)

Adds .deb generation for aarch64 and armv7 gnu targets in the nightly and deploy workflows.
This commit is contained in:
Clement Tsang 2022-05-28 16:14:25 -04:00 committed by GitHub
parent 42909dba35
commit 96d5b9b87d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 98 additions and 40 deletions

View file

@ -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.37.0 --locked
cargo deb --no-build
cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb
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: |
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

View file

@ -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.37.0 --locked
cargo deb --no-build
cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb
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: |
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

View file

@ -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"

2
Cross.toml Normal file
View file

@ -0,0 +1,2 @@
[build.env]
passthrough = ["RUST_BACKTRACE", "BTM_GENERATE"]

View file

@ -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):

View file

@ -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(())
}