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 libx11-dev libxrandr-dev -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 --trybuild=cmake
          xmake

      - name: 🚀 Upload
        uses: actions/upload-artifact@v4
        with:
          name: SimpleDrum_Linux_arm64.vst3
          path: ${{ github.workspace }}/build/SimpleDrum_artefacts/Release/VST3/SimpleDrum.vst3