name: macOS (DMG)

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: macos-11
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Update brew
        run: brew update

      - name: Install packages
        run: brew install sdl2 sdl2_mixer

      - name: Build
        run: |
          echo $(date +"%Y%m%d").$(echo $GITHUB_SHA | cut -b 1-7) > VERSION
          sh gargoyle_osx.sh

      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: Gargoyle.dmg
          path: gargoyle*.dmg
