-name: Publish npm package
+name: Publish package
on:
release:
- name: Production Build
run: pnpm build:prod
+ publish-jsr:
+ needs: build
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ id-token: write
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ # - name: Setup pnpm
+ # uses: pnpm/action-setup@v3
+ # with:
+ # version: 8
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20.x'
+ cache: 'pnpm'
+
+ # - name: Install Dependencies
+ # run: pnpm install --ignore-scripts --frozen-lockfile
+
+ - name: Read package.json version
+ id: package-version
+ uses: jaywcjlove/github-action-package@main
+
+ - name: Publish Release
+ if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
+ run: npx jsr publish
+
publish-npm:
needs: build
runs-on: ubuntu-latest
run: pnpm publish --no-git-checks --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-
- # publish-gpr:
- # needs: build
- # runs-on: ubuntu-latest
- # permissions:
- # contents: read
- # packages: write
-
- # steps:
- # - name: Checkout
- # uses: actions/checkout@v4
-
- # - name: Setup pnpm
- # uses: pnpm/action-setup@v3
- # with:
- # version: 8
-
- # - name: Setup Node.js
- # uses: actions/setup-node@v4
- # with:
- # node-version: '20.x'
- # registry-url: https://npm.pkg.github.com
- # cache: 'pnpm'
-
- # - name: Install Dependencies
- # run: pnpm install --ignore-scripts --frozen-lockfile
-
- # - name: Read package.json version
- # id: package-version
- # uses: jaywcjlove/github-action-package@main
-
- # - name: Publish Release
- # if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
- # run: pnpm publish --no-git-checks
- # env:
- # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}
-
- # - name: Publish Pre-Release
- # if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }}
- # run: pnpm publish --no-git-checks --tag next
- # env:
- # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}
-
- # - name: Publish Beta Release
- # if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }}
- # run: pnpm publish --no-git-checks --tag beta
- # env:
- # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}
<div align="center">
[![GitHub commit activity (master)](https://img.shields.io/github/commit-activity/m/poolifier/poolifier/master?color=brightgreen&logo=github)](https://github.com/poolifier/poolifier/graphs/commit-activity)
+[![Npm Version](https://badgen.net/npm/v/poolifier?icon=npm)](https://www.npmjs.com/package/poolifier)
[![Npm Weekly Downloads](https://badgen.net/npm/dw/poolifier?icon=npm)](https://www.npmjs.com/package/poolifier)
+[![JSR Version](https://jsr.io/badges/@poolifier/poolifier)](https://jsr.io/@poolifier/poolifier)
[![CI Workflow](https://github.com/poolifier/poolifier/actions/workflows/ci.yml/badge.svg)](https://github.com/poolifier/poolifier/actions/workflows/ci.yml)
[![Code Coverage](https://sonarcloud.io/api/project_badges/measure?project=poolifier_poolifier&metric=coverage)](https://sonarcloud.io/dashboard?id=poolifier_poolifier)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=poolifier_poolifier&metric=alert_status)](https://sonarcloud.io/dashboard?id=poolifier_poolifier)
## Installation
+### npm
+
```shell
npm install poolifier --save
```
+### jsr
+
+```shell
+npx jsr add @poolifier/poolifier
+```
+
## Usage
You can implement a poolifier [worker_threads](https://nodejs.org/api/worker_threads.html#class-worker) worker in a simple way by extending the class _ThreadWorker_: