name: DOS build

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3

    - name: cache toolchain
      id: cache-tc
      uses: actions/cache@v3
      with:
        path: ow
        key: openwatcom-cache1

    - name: install watcom C toolchain
      if: steps.cache-tc.outputs.cache-hit != 'true'
      run: |
        wget http://mutantstargoat.com/~nuclear/ow_bundle.tar.gz
        tar xzvf ow_bundle.tar.gz
        sed -i 's/HOME/GITHUB_WORKSPACE/g' ow/owsetenv-dos.sh

    - name: install nasm assembler
      run: |
        sudo apt-get install nasm

    - name: build
      run: |
        source ow/owsetenv-dos.sh
        wmake -f Makefile.wat

    - uses: actions/upload-artifact@v4
      with:
        name: termtris-dos
        path: |
          termtris.com

# vi:ts=2 sts=2 sw=2 expandtab:
