name: link

on: [push]

env:
  OAT_VERSION: "0.19.2"

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: Link assets
        uses: addnab/docker-run-action@v3
        with:
          image: ubuntu:noble
          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/code_post_gfx_mp/code_post_gfx_mp.ff
            zone_out/code_post_gfx/code_post_gfx.ff
            zone_out/localized_ui_mp/localized_ui_mp.ff