fix(ci): 修复发布流程改为手动触发并包含 package-lock

This commit is contained in:
YHH
2025-10-18 22:18:47 +08:00
parent 570e970e1c
commit 6b1e6c6fdc
4 changed files with 4120 additions and 837 deletions

View File

@@ -1,10 +1,13 @@
name: Release
on:
push:
branches:
- master
- main
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (仅预览,不实际发布)'
type: boolean
default: false
required: false
permissions:
contents: write
@@ -22,6 +25,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
@@ -43,7 +47,18 @@ jobs:
cd packages/core
npm run build:npm
- name: Release (Dry Run)
if: ${{ github.event.inputs.dry_run == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/core
npx semantic-release --dry-run
- name: Release
if: ${{ github.event.inputs.dry_run != 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}