From 0b3755978cd9f77d5260cad1f0c014a54ca5c2d8 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Wed, 25 May 2022 14:13:16 -0400 Subject: [PATCH] experiment with custom docker --- .github/workflows/nightly.yml | 12 ++++++++++-- Cross.toml | 6 ++++++ deployment/cargo_deb.sh | 3 +++ .../docker/aarch64-unknown-linux-gnu/Dockerfile | 4 ++++ deployment/docker/aarch64-unknown-linux-gnu/build | 5 +++++ .../docker/arm-unknown-linux-gnueabihf/Dockerfile | 4 ++++ deployment/docker/arm-unknown-linux-gnueabihf/build | 5 +++++ 7 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 deployment/cargo_deb.sh create mode 100644 deployment/docker/aarch64-unknown-linux-gnu/Dockerfile create mode 100644 deployment/docker/aarch64-unknown-linux-gnu/build create mode 100644 deployment/docker/arm-unknown-linux-gnueabihf/Dockerfile create mode 100644 deployment/docker/arm-unknown-linux-gnueabihf/build diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f2b2e0c55..054091115 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -358,9 +358,17 @@ jobs: gzip ./manpage/btm.1 - name: Build Debian release + uses: actions-rs/cargo@v1 + with: + command: deb + args: --no-build --no-strip + use-cross: ${{ matrix.triple.cross }} + env: + RUST_BACKTRACE: 1 + BTM_GENERATE_COMPLETIONS: true + + - name: Copy Debian release run: | - cargo install cargo-deb --version 1.37.0 --locked - cargo deb --no-build --no-strip cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_${{ matrix.triple.name }}.deb - name: Test Debian release diff --git a/Cross.toml b/Cross.toml index 163c644d3..65a56034e 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,8 @@ [build.env] passthrough = ["RUST_BACKTRACE", "BTM_GENERATE_COMPLETIONS"] + +[target.arm-unknown-linux-gnueabihf] +image = "clementtsang/cross:arm-unknown-linux-gnueabihf" + +[target.aarch64-unknown-linux-gnu] +image = "clementtsang/cross:aarch64-unknown-linux-gnu" diff --git a/deployment/cargo_deb.sh b/deployment/cargo_deb.sh new file mode 100755 index 000000000..114662f8c --- /dev/null +++ b/deployment/cargo_deb.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cargo install cargo-deb --version 1.37.0 --locked \ No newline at end of file diff --git a/deployment/docker/aarch64-unknown-linux-gnu/Dockerfile b/deployment/docker/aarch64-unknown-linux-gnu/Dockerfile new file mode 100644 index 000000000..e017d610a --- /dev/null +++ b/deployment/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -0,0 +1,4 @@ +FROM rustembedded/cross:aarch64-unknown-linux-gnu + +COPY stage/cargo_deb.sh / +RUN /cargo_deb.sh \ No newline at end of file diff --git a/deployment/docker/aarch64-unknown-linux-gnu/build b/deployment/docker/aarch64-unknown-linux-gnu/build new file mode 100644 index 000000000..0b3a43c5c --- /dev/null +++ b/deployment/docker/aarch64-unknown-linux-gnu/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../cargo_deb.sh ./stage/ +docker build -t clementtsang/cross:arm-unknown-linux-gnueabihf . \ No newline at end of file diff --git a/deployment/docker/arm-unknown-linux-gnueabihf/Dockerfile b/deployment/docker/arm-unknown-linux-gnueabihf/Dockerfile new file mode 100644 index 000000000..08e7838d6 --- /dev/null +++ b/deployment/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -0,0 +1,4 @@ +FROM rustembedded/cross:arm-unknown-linux-gnueabihf + +COPY stage/cargo_deb.sh / +RUN /cargo_deb.sh \ No newline at end of file diff --git a/deployment/docker/arm-unknown-linux-gnueabihf/build b/deployment/docker/arm-unknown-linux-gnueabihf/build new file mode 100644 index 000000000..0b3a43c5c --- /dev/null +++ b/deployment/docker/arm-unknown-linux-gnueabihf/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../cargo_deb.sh ./stage/ +docker build -t clementtsang/cross:arm-unknown-linux-gnueabihf . \ No newline at end of file