name: build

on:
  push:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: listsend - latest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain:
          - stable

    steps:
    - uses: actions/checkout@v4
    - name: Prep
      run: |
        sudo apt-get -y install musl-tools
        rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
        rustup target add x86_64-unknown-linux-musl
    - name: Build
      run: |
        cargo build --release --verbose --target=x86_64-unknown-linux-musl
    - name: 'Upload Artifact'
      uses: actions/upload-artifact@v4
      with:
        name: listsend
        path: /home/runner/work/listsend/listsend/target/x86_64-unknown-linux-musl/release/listsend
