diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e1cef89 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # The OIDC ID token is used for authentication with JSR. + steps: + - uses: actions/checkout@v4 + - run: npx jsr publish + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - name: npm build + run: deno task build + - name: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: cd npm && npm publish --provenance --access public diff --git a/README.md b/README.md index 46add99..d75a269 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ Lightweight util for generating random sentences, paragraphs and articles in English. Inspired by [Sentencer](https://github.com/kylestetz/Sentencer) and [metaphorpsum.com](http://metaphorpsum.com/). -[![NPM](https://badge.fury.io/js/txtgen.svg)](https://badge.fury.io/js/txtgen) +![CodeQL](https://github.com/ndaidong/txtgen/workflows/CodeQL/badge.svg) [![CI test](https://github.com/ndaidong/txtgen/workflows/ci-test/badge.svg)](https://github.com/ndaidong/txtgen/actions) [![Coverage Status](https://coveralls.io/repos/github/ndaidong/txtgen/badge.svg)](https://coveralls.io/github/ndaidong/txtgen) -![CodeQL](https://github.com/ndaidong/txtgen/workflows/CodeQL/badge.svg) +[![NPM](https://img.shields.io/npm/v/%40ndaidong%2Ftxtgen?color=32bb24)](https://www.npmjs.com/package/@ndaidong/txtgen) +[![JSR](https://jsr.io/badges/@ndaidong/txtgen?color=32bb24)](https://jsr.io/@ndaidong/txtgen) # Demo @@ -17,6 +18,8 @@ English. Inspired by [Sentencer](https://github.com/kylestetz/Sentencer) and ### Deno +https://jsr.io/@ndaidong/txtgen + ```sh deno add @ndaidong/txtgen @@ -64,6 +67,8 @@ for (let i = 0; i < 5; i++) { ### Node.js & Bun +https://www.npmjs.com/package/@ndaidong/txtgen + ```bash npm i @ndaidong/txtgen # pnpm diff --git a/deno.json b/deno.json index 968808b..b37b814 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@ndaidong/txtgen", - "version": "4.0.0", + "version": "4.0.1-rc1", "description": "Util for generating random sentences, paragraphs and articles in English", "homepage": "https://github.com/ndaidong/txtgen", "repository": { @@ -20,5 +20,14 @@ "test": { "include": ["tests"], "exclude": [] + }, + "publish": { + "include": [ + "LICENSE", + "README.md", + "mod.ts", + "utils/*.ts", + "tests/*.ts" + ] } }