Skip to content

Commit 3ec163a

Browse files
committed
ci(workflows): add vue-docs test package release script
1 parent 3ddfaf2 commit 3ec163a

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ jobs:
8686
run: pnpm release:alpha
8787

8888
- name: Publish Vue3 And Vue2 components
89-
run: pnpm pub:all
89+
run: pnpm pub:all && pnpm pub:site
9090
env:
9191
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
components:
88
description: |
99
输入需要打包的模块名称,多个以英文逗号分隔,
10-
例如: `theme,renderless,runtime`
10+
例如: `theme,renderless,runtime,docs`
1111
required: true
1212
type: string
1313
concurrency:
@@ -88,3 +88,10 @@ jobs:
8888
pnpm pub:all
8989
env:
9090
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
91+
92+
- name: Publish Docs
93+
if: contains(inputs.components, 'docs') == true
94+
run: |
95+
pnpm pub:site
96+
env:
97+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { pathFromPackages } from '../build/build-ui'
2+
import { pathFromExamples } from './releaseE2EConfig'
23
import path from 'node:path'
34
import fs from 'fs-extra'
45
import semver from 'semver'
@@ -47,9 +48,24 @@ const findAllpage = (packagesPath, updateVersion) => {
4748
}
4849
}
4950

51+
const releaseSiteAlpha = (updateVersion) => {
52+
const PKG_PATH = pathFromExamples('sites/package.json')
53+
const PKGContent = fs.readJSONSync(PKG_PATH)
54+
55+
PKGContent.name = PKGContent.name.replace('@opentiny', '@opentinyvue')
56+
if (updateVersion) {
57+
PKGContent.version = getPatchVersion(PKGContent.name, PKGContent.version)
58+
}
59+
PKGContent.devDependencies = { ...PKGContent.devDependencies, ...PKGContent.dependencies }
60+
delete PKGContent.dependencies
61+
62+
fs.writeFileSync(PKG_PATH, JSON.stringify(PKGContent, null, 2))
63+
}
64+
5065
export const releaseAlpha = ({ updateVersion }) => {
5166
const distLists = ['dist3/', 'dist2/', 'renderless/dist', 'theme/dist', 'theme-mobile/dist', 'theme-saas/dist']
5267
distLists.forEach((item) => {
5368
findAllpage(pathFromPackages(item), updateVersion)
5469
})
70+
releaseSiteAlpha(updateVersion)
5571
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs-extra'
22
import { pathFromWorkspaceRoot } from '../../config/vite'
33

4-
const pathFromExamples = (...args) => pathFromWorkspaceRoot('examples', ...args)
4+
export const pathFromExamples = (...args) => pathFromWorkspaceRoot('examples', ...args)
55

66
const playWrightConfigPath = pathFromExamples('vue3/playwright.config.js')
77

0 commit comments

Comments
 (0)