Skip to content

Update npm-publish.yml #2

Update npm-publish.yml

Update npm-publish.yml #2

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm --filter packages/ui test
- name: Build package
run: pnpm --filter packages/ui build
publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build package
run: pnpm --filter packages/ui build
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm --filter packages/ui publish --access public