name: release

on:
  push:
    branches:
      - main

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16

      - name: Install Dependencies
        run: yarn install

      - name: Build
        run: yarn build

      - name: Upload Release Asset
        uses: svenstaro/upload-release-action@v2
        with:
          file: ./lib/index.js
          asset_name: plugin.js
          overwrite: true
          release_name: "Release ${{ github.ref }}"
