Skip to content

Update publish.yml

Update publish.yml #4

Workflow file for this run

name: Publish to NPM
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build
run: |
npm i --package-lock-only
npm ci
npm run build --if-present
- name: Create .npmrc file
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}" > .npmrc
- name: Install Changesets CLI
run: npm install -g @changesets/cli
- name: Publish packages
run: changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}