From a8d8071193c0db550408de9da2f8d9d22b4eba76 Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Mon, 18 Dec 2023 11:47:15 +0100 Subject: [PATCH] Don't use cargo@v1 --- .github/workflows/release.yml | 80 +++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae3e53b..6216372 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,15 +33,9 @@ jobs: rustup show rustup component add rustfmt clippy - name: Code format check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt --check - name: Clippy check - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + run: cargo clippy -- -D warnings - name: Environment setup id: env shell: bash @@ -92,48 +86,72 @@ jobs: fail-fast: false matrix: job: - - { target: x86_64-unknown-linux-gnu, arch: amd64, os: ubuntu-20.04 } - - { target: x86_64-apple-darwin, arch: darwin, os: macos-latest } - - { target: aarch64-apple-darwin, arch: darwin, os: macos-latest } + - { + target: x86_64-unknown-linux-gnu, + arch: amd64, + os: ubuntu-20.04, + build-cmd: "cargo", + } + - { + target: x86_64-apple-darwin, + arch: darwin, + os: macos-latest, + build-cmd: "cargo", + } + - { + target: aarch64-apple-darwin, + arch: darwin, + os: macos-latest, + build-cmd: "cargo", + } - { target: x86_64-unknown-linux-musl, arch: amd64, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } - { target: arm-unknown-linux-gnueabi, arch: armel, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } - { target: arm-unknown-linux-gnueabihf, arch: armhf, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } - { target: armv7-unknown-linux-gnueabihf, arch: armhf, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } - { target: aarch64-unknown-linux-gnu, arch: arm64, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } - { target: aarch64-unknown-linux-musl, arch: arm64, os: ubuntu-20.04, - use-cross: true, + build-cmd: "cross", } # win is possible to build on, but we don't target it for now - # - { target: x86_64-pc-windows-msvc, arch: win64, os: windows-2019 } - # - { target: x86_64-pc-windows-gnu , arch: win64 , os: windows-2019 } + # - { + # target: x86_64-pc-windows-msvc, + # arch: win64, + # os: windows-2019, + # build-cmd: "cargo", + # } + # - { target: x86_64-pc-windows-gnu , + # arch: win64, + # os: windows-2019, + # build-cmd: "cargo", + # } steps: - name: Checkout source code uses: actions/checkout@v4 @@ -165,38 +183,26 @@ jobs: ;; esac + cargo install cross --git https://github.com/cross-rs/cross + - name: Install Rust toolchain run: | rustup show rustup target add ${{ matrix.job.target }} - name: zenoh-plugin-ros1 > Build - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.job.use-cross }} - command: build - args: --release --target=${{ matrix.job.target }} -p zenoh-plugin-ros1 + run: ${{ matrix.job.build-cmd }} build --release --target=${{ matrix.job.target }} -p zenoh-plugin-ros1 - name: zenoh-bridge-ros1 > Build - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.job.use-cross }} - command: build - args: --release --target=${{ matrix.job.target }} -p zenoh-bridge-ros1 + run: ${{ matrix.job.build-cmd }} build --release --target=${{ matrix.job.target }} -p zenoh-bridge-ros1 - name: zenoh-plugin-ros1 > Debian package if: contains(matrix.job.target, '-linux-gnu') - uses: actions-rs/cargo@v1 - with: - command: deb - args: --no-build --target=${{ matrix.job.target }} -p zenoh-plugin-ros1 + run: cargo deb --no-build --target=${{ matrix.job.target }} -p zenoh-plugin-ros1 - name: zenoh-bridge-ros1 > Debian package if: contains(matrix.job.target, '-linux-gnu') - uses: actions-rs/cargo@v1 - with: - command: deb - args: --no-build --target=${{ matrix.job.target }} -p zenoh-bridge-ros1 + run: cargo deb --no-build --target=${{ matrix.job.target }} -p zenoh-bridge-ros1 - name: Packaging id: package