name: build
on: [ push, pull_request ]
jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        arch: [x86_64, arm, aarch64]
    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true
    - name: Build
      run: |
        ci/build-docker.sh ${{ matrix.arch }}
    - name: Generate checksums
      run: |
        for f in btdu-*-${{ matrix.arch }} ; do
          sha256sum "$f" | tee "$f".sha256sum
        done
    - name: Upload binary
      uses: actions/upload-artifact@v4
      with:
        name: btdu-${{ matrix.arch }}
        path: |
          btdu-*-${{ matrix.arch }}
          btdu-*-${{ matrix.arch }}.sha256sum
