Skip to content

演示和发布包拆开 #1

演示和发布包拆开

演示和发布包拆开 #1

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy example to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i
- name: 编译 package
run: npm run build
- name: 发布到npmjs
env:
NPM_TPKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ env.NPM_TPKEN != '' }}
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm publish