name: Build/release

on: workflow_dispatch

jobs:
  release:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]

    steps:
      - name: Checkout code
        uses: actions/checkout@v1

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v1
        with:
          node-version: 18

      - name: Build and release with electron-builder
        run: |
          export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
          yarn install
          yarn dist -c.snap.publish=github
        shell: bash
