name: Build OpenPnP Capture Distribution

on: 
  push:
  pull_request:

jobs:
  build: 
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        arch: [x86_64, aarch64]

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2

      - name: Install packages on Linux
        if: ${{ matrix.os == 'ubuntu-latest' }}
        run: sudo apt-get update -y && sudo apt-get install -y nasm libgtk-3-dev

      - name: Build and prepare deploy
        run: |
          mkdir -p build deploy && cd build && cmake .. && make

      - name: Copy deploy artifacts if running on OSX
        run: |
               cp build/mac/tests/openpnp-capture-test deploy/openpnp-capture-test-${{ matrix.os }}-${{ matrix.arch }}
               cp build/libopenpnp-capture.dylib deploy/libopenpnp-capture-${{ matrix.os }}-${{ matrix.arch }}
        if: matrix.os == 'macos-latest'

      - name: Copy deploy artifacts if running on Linux
        run: |
               cp build/linux/tests/openpnp-capture-test deploy/openpnp-capture-test-${{ matrix.os }}-${{ matrix.arch }}
               cp build/libopenpnp-capture.so deploy/libopenpnp-capture-${{ matrix.os }}-${{ matrix.arch }}
        if: matrix.os == 'ubuntu-latest'

      - name: Upload Artifacts
        uses: actions/upload-artifact@v2
        with: 
          path: |
            deploy/*

      - name: Create Release
        if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
        uses: ncipollo/release-action@v1
        with:
            artifacts: "deploy/*"
            token: ${{ secrets.GITHUB_TOKEN }}

Undo revert and add conditional artifacts renaming depending on OS and ARCH under deploy/
Undo revert and add conditional artifacts renaming depending on OS and ARCH under deploy/
