name: Build and Upload Caido Plugin

on:
    push:
    pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: latest

      - name: Install dependencies
        run: |
          bun install

      - name: Build plugin
        run: |
          bun run build

      - name: Upload plugin artifact
        uses: actions/upload-artifact@v4
        with:
          name: caido-plugin
          path: dist
