statusbar 0.5.2

dwm statusbar
on:
  push:
    branches: [ master ]
    tags: [ 'v*' ]
  pull_request:
    branches: [ master ]

name: binaries

jobs:
  # release binaries
  release-bins:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        targets:
          - x86_64-unknown-linux-musl
        bins:
          - statusbar

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 # master
        with:
          toolchain: nightly
          target: ${{ matrix.targets }}
      - uses: Swatinem/rust-cache@v2
      - run: cargo install cross || true
      - run: cross build --bin ${{ matrix.bins }} --locked --release --target ${{ matrix.targets }}

      - name: archive
        run: |
          tar -czvf ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz \
              -C target/${{ matrix.targets }}/release/ ${{ matrix.bins }}

      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        with:
          name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
          path: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz

      - name: Upload binary to release
        if: ${{ startsWith(github.ref, 'refs/tags/v') }}
        uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
          asset_name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
          tag: ${{ github.ref }}
          overwrite: true