on: [push]
jobs:
  deploy:
    runs-on: docker
    container: debian:sid
    steps:
      - run: apt update
      - name: Install prerequisites
        run: apt install --no-install-recommends -y git
      - name: Install toolchain
        run: apt install --no-install-recommends -y gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu make
      - name: Install dependencies
        run: apt install --no-install-recommends -y libelf-dev
      - name: Clone repository
        run: git clone git@git.m724.eu:Minecon724/crisc.git .
      - name: Package for x86_64
        run: CC=x86_64-linux-gnu-gcc PROGRAM_NAME=crisc-x86_64 make
      - name: Package for aarch64
        run: CC=aarch64-linux-gnu-gcc PROGRAM_NAME=crisc-aarch64 make
      - name: Upload artifact
        uses: https://github.com/actions/upload-artifact@v4
        with:
          path: build/criscv-*