From 4b613b716c129fc712cd480d792bd4b28cc5ac93 Mon Sep 17 00:00:00 2001 From: epi Date: Sat, 14 Sep 2024 22:22:37 -0400 Subject: [PATCH] migrating from actions-rs to dtolnay stuff; matrix build; test 5 --- .github/workflows/build-release.yml | 14 +++++++++ .github/workflows/build.yml | 47 ++++++++++++++++++----------- 2 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..65070dfc --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,14 @@ +jobs: + release: + name: Release - ${{ matrix.platform.os_name }} + # if: startsWith( github.ref, 'refs/tags/v' ) || github.ref == 'refs/tags/test-release' + strategy: + matrix: + platform: + - os_name: Linux-x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-musl + bin: ubi + name: ubi-Linux-x86_64-musl.tar.gz + cross: false + cargo_command: cargo diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8f4cc71..846b28fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,8 @@ name: CD Pipeline on: [push] jobs: - build-nix: + build-nix-release: + name: Release - ${{ matrix.os }} env: IN_PIPELINE: true runs-on: ${{ matrix.os }} @@ -38,25 +39,37 @@ jobs: pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig steps: - uses: actions/checkout@v4 - - name: Install System Dependencies - run: | - env - sudo apt-get update - sudo apt-get install -y --no-install-recommends libssl-dev pkg-config gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu musl-tools - - name: Set up Rust toolchain - uses: dtolnay/rust-toolchain@master - env: - PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }} - OPENSSL_DIR: /usr/lib/ssl + - name: Cache cargo & target directories + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: + command: build + target: ${{ matrix.target }} + args: "--locked --release" + strip: true toolchain: stable - run: \ - cargo install cross --git https://github.com/cross-rs/cross - cross build --target ${{ matrix.target }} --release - - name: Strip symbols from binary - run: | - strip -s ${{ matrix.path }} || arm-linux-gnueabihf-strip -s ${{ matrix.path }} || aarch64-linux-gnu-strip -s ${{ matrix.path }} + # - uses: actions/checkout@v4 + # - name: Install System Dependencies + # run: | + # env + # sudo apt-get update + # sudo apt-get install -y --no-install-recommends libssl-dev pkg-config gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu musl-tools + # - name: Set up Rust toolchain + # uses: dtolnay/rust-toolchain@master + # env: + # PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }} + # OPENSSL_DIR: /usr/lib/ssl + # with: + # toolchain: stable + # run: \ + # cargo install cross --git https://github.com/cross-rs/cross + # cross build --target ${{ matrix.target }} --release + + # - name: Strip symbols from binary + # run: | + # strip -s ${{ matrix.path }} || arm-linux-gnueabihf-strip -s ${{ matrix.path }} || aarch64-linux-gnu-strip -s ${{ matrix.path }} - name: Build tar.gz for homebrew installs if: matrix.type == 'ubuntu-x64' run: |