name: Linux arm64
run-name: Build And Test

on: [push]

env:
  XMAKE_ROOT: "y"

jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - name: 🧾 Check out
        uses: actions/checkout@v3
        with:
          submodules: "recursive"

      - name: 🤖 Install Cmake
        run: |
          apt update
          apt install cmake crossbuild-essential-arm64 -y          

      - name: 🍗 Setup XMake
        uses: xmake-io/github-action-setup-xmake@v1
        with:
          xmake-version: latest
          actions-cache-folder: '.xmake-cache'
          actions-cache-key: 'xmake-ubuntu'

      - name: 🏗️ Build
        run: |
          xmake f -m release -p linux -a x86_64 --trybuild=cmake
          xmake require -v -j 10 --extra={system=false} libsdl2-dev
          xmake          

      - name: 🚀 Upload
        uses: actions/upload-artifact@v3
        with:
          name: SimpleDrum_Linux_amd64.vst3
          path: ${{ github.workspace }}/build/SimpleDrum_artefacts/VST3/