name: Build eismuliplexer for linux
run-name: Building eismuliplexer for linux
on: [push]

jobs:
  Build:
    runs-on: ubuntu-20.04
    steps:
      - name: Install dependancies
        run: apt update; apt install -y libusb-1.0-0-dev cmake
      - name: Check out repository code
        uses: ischanx/checkout@8c80eac3058d03dc5301629e8f7d59ae255d6cc3
      - name: Version
        id: version
        run: git fetch -a; echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
      - name: Build
        run: mkdir ${{ gitea.workspace }}/build; cd ${{ gitea.workspace }}/build; cmake -DCMAKE_BUILD_TYPE=Release -DGIT_TAG=${{ steps.version.outputs.tag }} ..; make
      - name: Package
        run: cd ${{ gitea.workspace }}/build; make package
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
            name: eismultiplexer-linux-x86_64-${{ steps.version.outputs.tag }}
            path: ${{ gitea.workspace }}/build/packaged/${{ steps.version.outputs.tag }}/*
