name: Create artifact [MAC]

on: 
  workflow_dispatch: {}

jobs:
  build:
    runs-on: macos-latest
    steps:
      - name: Check out Git repository
        uses: actions/checkout@v4

      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: npm install & build
        run: |
          npm install
          npm install "dmg-license" --save-optional
          npm run build

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: macos-build
          retention-days: 3
          path: |
            build
            !build/*-unpacked
            !build/.icon-ico
  build-beta:
    runs-on: macos-latest
    steps:
      - name: Check out Git repository
        uses: actions/checkout@v3
        with:
          ref: beta

      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: npm install & build
        run: |
          npm install
          npm install "dmg-license" --save-optional
          npm run build

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: macos-build-beta
          retention-days: 3
          path: |
            build
            !build/*-unpacked
            !build/.icon-ico
