name: Publish
run-name: Publish
on:
  push:
    branches:
      - master

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
      - name: Clone repo
        uses: actions/checkout@v6
      - name: Install dependencies
        run: bun install --frozen-lockfile
      - name: Lint TypeScript
        run: bun lint:tsc
      - name: Lint Biome
        run: bun lint:biome
      - name: Build
        run: bun run build
      - name: Publish react-godot-renderer
        uses: JS-DevTools/npm-publish@v4
        with:
          package: packages/react-godot-renderer
          access: public
          token: ${{ secrets.NPM_TOKEN }}
          registry: https://registry.npmjs.org
