Skip to content

chore: Update package.json and GitHub Actions workflow for pnpm integ… #4

chore: Update package.json and GitHub Actions workflow for pnpm integ…

chore: Update package.json and GitHub Actions workflow for pnpm integ… #4

Workflow file for this run

name: Publish Package to NPM
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
scope: '@crawlab'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Configure npm
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Build
run: pnpm build
- name: Publish to NPM
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}