Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
environment: production | |
permissions: | |
contents: read | |
id-token: write # The OIDC ID token is used for authentication with JSR. | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.1.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build the package | |
run: pnpm run build | |
- name: Check for NPM token | |
run: | | |
echo "NPM Token: ${{ secrets.NPM_TOKEN }}" | |
- name: Publish to npm | |
run: pnpm publish --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to jsr | |
run: pnpm jsr:publish |