|
7 | 7 | components: |
8 | 8 | description: | |
9 | 9 | 输入需要打包的模块名称,多个以英文逗号分隔, |
10 | | - 例如: `theme,renderless,runtime` |
| 10 | + 例如: `theme,renderless,runtime,docs,utils,hooks` |
11 | 11 | required: true |
12 | 12 | type: string |
13 | 13 | concurrency: |
|
25 | 25 | script: | |
26 | 26 | const branchName = `${{ github.ref_name }}` |
27 | 27 | const moduleName = `${{ inputs.components }}` |
| 28 | + const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils','hooks'] |
28 | 29 |
|
29 | | - if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('runtime')) { |
| 30 | + if (!validModuleNames.some(name => moduleName.includes(name))) { |
30 | 31 | throw new Error('请输入正确的包名称') |
31 | 32 | } |
32 | 33 |
|
|
80 | 81 | if: contains(inputs.components, 'runtime') == true |
81 | 82 | run: pnpm build:runtime |
82 | 83 |
|
| 84 | + - name: Run Build Utils |
| 85 | + if: contains(inputs.components, 'utils') == true |
| 86 | + run: pnpm build:utils |
| 87 | + |
| 88 | + - name: Run Build Hooks |
| 89 | + if: contains(inputs.components, 'hooks') == true |
| 90 | + run: pnpm build:hooks |
| 91 | + |
83 | 92 | - name: Publish |
84 | 93 | run: | |
85 | 94 | pnpm pub:all |
86 | 95 | env: |
87 | 96 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 97 | + |
| 98 | + - name: Publish Utils |
| 99 | + if: contains(inputs.components, 'utils') == true |
| 100 | + run: | |
| 101 | + pnpm pub:utils |
| 102 | + env: |
| 103 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 104 | + |
| 105 | + - name: Publish Runtime |
| 106 | + if: contains(inputs.components, 'runtime') == true |
| 107 | + run: | |
| 108 | + pnpm pub:runtime |
| 109 | + env: |
| 110 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 111 | + |
| 112 | + - name: Publish Hooks |
| 113 | + if: contains(inputs.components, 'hooks') == true |
| 114 | + run: | |
| 115 | + pnpm pub:hooks |
| 116 | + env: |
| 117 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 118 | + |
| 119 | + - name: Publish Docs |
| 120 | + if: contains(inputs.components, 'docs') == true |
| 121 | + run: | |
| 122 | + pnpm pub:site |
| 123 | + env: |
| 124 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments