chore: publish on both jsr & npm (0.1.2)

This commit is contained in:
Shibo Lyu 2024-05-05 12:03:02 +08:00
parent 1bff47e2a3
commit 182314c0f6
3 changed files with 31 additions and 2 deletions

27
.github/workflows/publish_npm.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: Publish Package to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Setup Deno
# uses: denoland/setup-deno@v1
uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 # v1.1.2
with:
deno-version: v1.x
- run: deno run -A scripts/build_npm.ts
- run: npm install -g npm
- run: cd npm && npm ci
- run: cd npm && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}