ci: add docs/utils/hooks auto build and publish (#3588)
This commit is contained in:
parent
bbdcfe55e4
commit
8b2f2b3612
|
@ -7,7 +7,7 @@ on:
|
||||||
components:
|
components:
|
||||||
description: |
|
description: |
|
||||||
输入需要打包的模块名称,多个以英文逗号分隔,
|
输入需要打包的模块名称,多个以英文逗号分隔,
|
||||||
例如: `theme,renderless,runtime`
|
例如: `theme,renderless,runtime,docs,utils,hooks`
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
concurrency:
|
concurrency:
|
||||||
|
@ -25,8 +25,9 @@ jobs:
|
||||||
script: |
|
script: |
|
||||||
const branchName = `${{ github.ref_name }}`
|
const branchName = `${{ github.ref_name }}`
|
||||||
const moduleName = `${{ inputs.components }}`
|
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('请输入正确的包名称')
|
throw new Error('请输入正确的包名称')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +81,44 @@ jobs:
|
||||||
if: contains(inputs.components, 'runtime') == true
|
if: contains(inputs.components, 'runtime') == true
|
||||||
run: pnpm build:runtime
|
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
|
- name: Publish
|
||||||
run: |
|
run: |
|
||||||
pnpm pub:all
|
pnpm pub:all
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
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…
Reference in New Issue