name: Build

on:
  push:
    tags: "*"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - name: Build sources
        run: npm i # Build is part of the `prepare` hook that runs as post install

      - name: Uploading files
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ./build/*.js
          tag: ${{ github.ref }}
          overwrite: true
          file_glob: true
