Skip to content

rm npm publish from CI, use pnpm run release #55

rm npm publish from CI, use pnpm run release

rm npm publish from CI, use pnpm run release #55

Workflow file for this run

name: ci
on:
# Run workflow when a PR is merged onto main
push:
tags:
- 'v*.*.*'
branches:
- main
# Run workflow on any open PR against main branch
pull_request:
types: ['opened', 'reopened', 'ready_for_review', 'synchronize']
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
pr-check:
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
env:
NODE_ENV: development
steps:
# Checkout repository files
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
# Add Node.js and npm to runner
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
# Install project dependencies with pnpm
- name: Install dependencies
env:
# Note: NODE_ENV needs to be set to development to
# install jest and other dev dependencies
NODE_ENV: development
run: pnpm install
# Check that packages can build without errors
- name: Builds without errors
env:
NODE_ENV: production
run: pnpm build
# Check for linting errors
- name: Check for linting errors
run: pnpm lint
# Check that project unit tests are successful
- name: Run unit tests
run: pnpm test
publish:
needs: pr-check
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: "18.18.0"
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Release
run: pnpm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}