name: build-nmage

on:
  create:
  workflow_dispatch:

jobs:
  build-nmage-macos:
    runs-on: macos-12
    steps:
    
      - name: Install golang
        uses: actions/setup-go@v3
        with:
          go-version: '>=1.22'

      - name: Install assimp-go dylib
        run: sudo mkdir -p /usr/local/lib && sudo wget https://github.com/bloeys/assimp-go/releases/download/v0.4.2/libassimp_darwin_amd64.dylib -O /usr/local/lib/libassimp.5.dylib

      - name: Install SDL2
        run: brew install sdl2{,_image,_mixer,_ttf,_gfx} pkg-config

      - name: Clone nmage
        run: git clone https://github.com/bloeys/nmage

      - name: build nmage
        working-directory: nmage
        run: go build .
