name: Publish Userscript Push

on:
  push:
    branches: [master]

  # Allows you to run this workflow manually from the Actions tab.
  workflow_dispatch:

jobs:
  pre-release:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3

      - name: "Use Node.js 18.x"
        uses: actions/setup-node@master
        with:
          node-version: 18.x

      - name: Install dependencies
        run: yarn install

      - name: Lint
        run: yarn lint:all

      - name: Build userscript
        run: yarn userscript:release

      - name: Pre-release userscript
        uses: marvinpinto/action-automatic-releases@latest
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          automatic_release_tag: "latest"
          prerelease: true
          title: "Development Build"
          files: |
            packages/userscript/output/*

name: Publish Userscript Push

on:
  push:
    branches: [master]

  # Allows you to run this workflow manually from the Actions tab.
  workflow_dispatch:

jobs:
  pre-release:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3

      - name: "Use Node.js 18.x"
        uses: actions/setup-node@master
        with:
          node-version: 18.x

      - name: Install dependencies
        run: yarn install

      - name: Lint
        run: yarn lint:all

      - name: Build userscript
        env:
          NODE_ENV: development
        run: yarn userscript:release

      - name: Pre-release userscript
        uses: marvinpinto/action-automatic-releases@latest
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          automatic_release_tag: "latest"
          prerelease: true
          title: "Development Build"
          files: |
            packages/userscript/output/*

Set development flag for dev build
ci: Set development flag for dev build
