Skip to content

Publish to npm

Publish to npm #4

Workflow file for this run

name: Publish to npm
on:
# 手动触发
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
# 检出代码
- name: Checkout code
uses: actions/checkout@v4
# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
# 设置 node
- name: Setup node
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
registry-url: https://registry.npmjs.org
# 安装依赖
- name: Install dependencies
run: pnpm install --frozen-lockfile
# 发布到 npm
- name: Publish to npm
working-directory: ./packages/core
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}