name: link

on: [push]

env:
  OAT_VERSION: "0.14.0"

jobs:
  link-linux:
    name: Link assets on Linux
    runs-on: ubuntu-latest

    steps:
      - name: Check out files
        uses: actions/checkout@v4
        with:
          submodules: true
          fetch-depth: 0
          # NOTE - If LFS ever starts getting used for storing zones, switch this to true!
          lfs: false
          token: ${{ secrets.SUBMODULE_PAT }}

      - name: Make sure we have the deps
        run: |
          git submodule update --init --recursive

      - name: Link assets
        uses: addnab/docker-run-action@v3
        with:
          image: ubuntu:mantic
          options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
          run: |
            cd ${{ github.workspace }}
            export OAT_VERSION=${{ env.OAT_VERSION  }}
            ./.gitea/scripts/ci.sh

      - name: Upload assets
        uses: actions/upload-artifact@v3
        with:
          name: assets
          path: |
            zone_out/plutonium_menus_mp/mod.ff
