dependency_runner 1.4.0

ldd for Windows - and more!
Documentation
on:
  push:
    tags:
      - "v*"

name: Dependency Runner Deploy

jobs:
  deploy:
    name: ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-pc-windows-msvc
            os: windows-latest
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-unknown-linux-musl
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-musl
            os: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}

      - name: Install Cross
        if: matrix.os == 'ubuntu-latest' && (contains(matrix.target, 'linux') || contains(matrix.target, 'musl'))
        uses: taiki-e/install-action@cross

      - name: Build
        run: |

          if [ "${{ matrix.os }}" = "ubuntu-latest" ] && ([ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ] || [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ] || [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]); then
            cross build --target ${{ matrix.target }} --all-features --release
          else
            cargo build --target ${{ matrix.target }} --all-features --release
          fi
        shell: bash

      - name: Package
        shell: bash
        run: |

          cd target/${{ matrix.target }}/release
          if [ "${{ matrix.os }}" = "windows-latest" ]; then
            7z a "../../../deprun-${{ matrix.target }}.zip" "deprun.exe"
            7z a "../../../wldd-${{ matrix.target }}.zip" "wldd.exe"
          else
            tar -czvf "../../../deprun-${{ matrix.target }}.tar.gz" deprun
            tar -czvf "../../../wldd-${{ matrix.target }}.tar.gz" wldd
          fi

      - name: Release
        uses: softprops/action-gh-release@v2
        with:
          files: |

            deprun-${{ matrix.target }}.*
            wldd-${{ matrix.target }}.*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}