diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f929079 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish to npm + +on: + push: + branches: [main] + paths: + - "src/**" + - "package.json" + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Build + run: bun run build + + - name: Setup npm auth + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Publish + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 32dbc9d..0000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -# Skip optional sharp dependency (not needed for text embeddings) -sharp_ignore_global_libvips=1 diff --git a/package.json b/package.json index 5c939f9..b888ace 100644 --- a/package.json +++ b/package.json @@ -56,12 +56,6 @@ }, "trustedDependencies": [ "@biomejs/biome", - "protobufjs", - "sharp" - ], - "bun": { - "install": { - "optional": true - } - } + "protobufjs" + ] }