diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c410d..f60f3eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,12 @@ jobs: pnpm i pnpm test - publish-npm: + publish: needs: test runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -28,14 +31,17 @@ jobs: node-version: 18.x registry-url: https://registry.npmjs.org/ - uses: pnpm/action-setup@v4 - - run: | - pnpm i - pnpm publish --no-git-checks + - name: Install deps + run: pnpm i + - name: Publish to NPM + run: pnpm publish --no-git-checks env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish to JSR + run: pnpm dlx jsr publish deploy-demo: - needs: publish-npm + needs: publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 50c4e2a..5dc8dcb 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![NPM Version](https://img.shields.io/npm/v/cc-gram.svg?style=for-the-badge)](https://www.npmjs.com/package/cc-gram) [![NPM Downloads](https://img.shields.io/npm/dt/cc-gram.svg?style=for-the-badge)](https://www.npmjs.com/package/cc-gram) +![JSR Version](https://img.shields.io/jsr/v/%40eastsun5566/cc-gram?style=for-the-badge) [![Test Status](https://img.shields.io/github/actions/workflow/status/EastSun5566/cc-gram/test.yml?style=for-the-badge)](https://github.com/EastSun5566/cc-gram/actions/workflows/test.yml) [![License](https://img.shields.io/github/license/EastSun5566/cc-gram.svg?style=for-the-badge)](https://github.com/EastSun5566/cc-gram/blob/main/LICENSE)