Skip to content

Commit 4e4784a

Browse files
authored
ci(workflows): add hooks package automation script (#2868)
1 parent c17a434 commit 4e4784a

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

.github/workflows/auto-all-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ jobs:
7070
- name: Run Build Utils
7171
run: pnpm build:utils
7272

73+
- name: Run Build Hooks
74+
run: pnpm build:hooks
75+
7376
- name: Run Build Runtime
7477
run: pnpm build:runtime
7578

7679
- name: Publish Vue3 And Vue2 components
77-
run: pnpm pub:all && pnpm pub:utils
80+
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks
7881
env:
7982
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8083

.github/workflows/dispatch-all-publish-alpha.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,16 @@ jobs:
8282
- name: Run Build Utils
8383
run: pnpm build:utils
8484

85+
- name: Run Build Hooks
86+
run: pnpm build:hooks
87+
8588
- name: Run Build Runtime
8689
run: pnpm build:runtime
8790

8891
- name: Run Release alpha
8992
run: pnpm release:alpha
9093

9194
- name: Publish Vue3 And Vue2 components
92-
run: pnpm pub:all && pnpm pub:utils && pnpm pub:site
95+
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks && pnpm pub:site
9396
env:
9497
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

.github/workflows/dispatch-renderless-theme-publish-alpha.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
components:
88
description: |
99
输入需要打包的模块名称,多个以英文逗号分隔,
10-
例如: `theme,renderless,runtime,docs,utils`
10+
例如: `theme,renderless,runtime,docs,utils,hooks`
1111
required: true
1212
type: string
1313
concurrency:
@@ -25,7 +25,7 @@ jobs:
2525
script: |
2626
const branchName = `${{ github.ref_name }}`
2727
const moduleName = `${{ inputs.components }}`
28-
const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils']
28+
const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils','hooks']
2929
3030
if (!validModuleNames.some(name => moduleName.includes(name))) {
3131
throw new Error('请输入正确的包名称')
@@ -85,6 +85,10 @@ jobs:
8585
if: contains(inputs.components, 'utils') == true
8686
run: pnpm build:utils
8787

88+
- name: Run Build Hooks
89+
if: contains(inputs.components, 'hooks') == true
90+
run: pnpm build:hooks
91+
8892
- name: Run Release alpha
8993
run: pnpm release:alpha -u
9094

@@ -101,6 +105,13 @@ jobs:
101105
env:
102106
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
103107

108+
- name: Publish Hooks
109+
if: contains(inputs.components, 'hooks') == true
110+
run: |
111+
pnpm pub:hooks
112+
env:
113+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
114+
104115
- name: Publish Docs
105116
if: contains(inputs.components, 'docs') == true
106117
run: |

internals/cli/src/commands/release/releaseAlpha.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export const releaseAlpha = ({ updateVersion }) => {
7272
'theme/dist',
7373
'theme-mobile/dist',
7474
'theme-saas/dist',
75-
'utils'
75+
'utils',
76+
'vue-hooks'
7677
]
7778
distLists.forEach((item) => {
7879
findAllpage(pathFromPackages(item), updateVersion)

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"build:themeSaas": "pnpm -C packages/theme-saas build:fast",
6767
"build:themeMobile": "pnpm -C packages/theme-mobile build:fast",
6868
"build:utils": "pnpm -C packages/utils build",
69+
"build:hooks": "pnpm -C packages/vue-hooks build",
6970
"build:internals": "pnpm \"--filter=./internals/*\" build",
7071
"build:virtual-template": "pnpm --filter @opentiny-internal/unplugin-virtual-template build",
7172
"build:site": "pnpm i -g pnpm && pnpm build:vite-import && pnpm build:virtual-template && pnpm -C examples/sites build",
@@ -82,6 +83,7 @@
8283
"pub:renderless": "pnpm --filter=\"./packages/renderless/dist\" publish --no-git-checks --access=public",
8384
"pub:runtime": "pnpm --filter=\"./packages/vue-runtime/\" publish --no-git-checks --access=public",
8485
"pub:utils": "pnpm --filter=\"./packages/utils/\" publish --no-git-checks --access=public",
86+
"pub:hooks": "pnpm --filter=\"./packages/vue-hooks/\" publish --no-git-checks --access=public",
8587
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pnpm pub:runtime",
8688
"pub:site": "pnpm -C examples/sites pub",
8789
"// ---------- 自动化发测试包 ----------": "",

0 commit comments

Comments
 (0)