Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .github/workflows/dispatch-renderless-theme-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
components:
description: |
输入需要打包的模块名称,多个以英文逗号分隔,
例如: `theme,renderless,runtime`
例如: `theme,renderless,runtime,docs,utils,hooks`
required: true
type: string
concurrency:
Expand All @@ -25,8 +25,9 @@ jobs:
script: |
const branchName = `${{ github.ref_name }}`
const moduleName = `${{ inputs.components }}`
const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils','hooks']

if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('runtime')) {
if (!validModuleNames.some(name => moduleName.includes(name))) {
throw new Error('请输入正确的包名称')
}

Expand Down Expand Up @@ -80,8 +81,44 @@ jobs:
if: contains(inputs.components, 'runtime') == true
run: pnpm build:runtime

- name: Run Build Utils
if: contains(inputs.components, 'utils') == true
run: pnpm build:utils

- name: Run Build Hooks
if: contains(inputs.components, 'hooks') == true
run: pnpm build:hooks

- name: Publish
run: |
pnpm pub:all
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Utils
if: contains(inputs.components, 'utils') == true
run: |
pnpm pub:utils
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Runtime
if: contains(inputs.components, 'runtime') == true
run: |
pnpm pub:runtime
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Hooks
if: contains(inputs.components, 'hooks') == true
run: |
pnpm pub:hooks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Docs
if: contains(inputs.components, 'docs') == true
run: |
pnpm pub:site
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading