Skip to content

Commit fff7930

Browse files
authored
ci(workflow): fix runtime publish alpha registry error (#3001)
* ci(workflow): fix runtime publish alpha registry error * ci(workflow): fix runtime publish alpha registry error * ci(workflow): fix runtime publish alpha registry error
1 parent 10f537f commit fff7930

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
run: pnpm build:runtime
7575

7676
- name: Publish Vue3 And Vue2 components
77-
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks
77+
run: pnpm pub:all && pnpm pub:runtime && pnpm pub:utils && pnpm pub:hooks
7878
env:
7979
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8080

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ jobs:
8989
run: pnpm release:alpha
9090

9191
- name: Publish Vue3 And Vue2 components
92-
run: pnpm pub:all && pnpm pub:utils && pnpm pub:hooks && pnpm pub:site
92+
run: pnpm pub:all && pnpm pub:runtime && pnpm pub:utils && pnpm pub:hooks && pnpm pub:site
9393
env:
9494
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ jobs:
101101
env:
102102
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
103103

104+
- name: Publish Runtime
105+
if: contains(inputs.components, 'runtime') == true
106+
run: |
107+
pnpm pub:runtime
108+
env:
109+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
110+
104111
- name: Publish Hooks
105112
if: contains(inputs.components, 'hooks') == true
106113
run: |

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,22 @@ const findAllpage = (packagesPath, updateVersion) => {
4040
.replace(/@opentiny\/vue/g, '@opentinyvue/vue')
4141
.replace(/@opentiny\/utils/g, '@opentinyvue/utils')
4242

43-
if (packagesPath.endsWith('package.json') && updateVersion) {
43+
if (packagesPath.endsWith('package.json')) {
4444
const packageJSON = JSON.parse(result)
45-
packageJSON.version = getPatchVersion(packageJSON.name, packageJSON.version)
45+
const dependenciesVersion = `~${packageJSON.version.split('.').slice(0, 2).join('.')}.0`
46+
47+
if (updateVersion) {
48+
packageJSON.version = getPatchVersion(packageJSON.name, packageJSON.version)
49+
}
50+
51+
if (packageJSON.dependencies) {
52+
Object.keys(packageJSON.dependencies).forEach((key) => {
53+
if (packageJSON.dependencies[key] === 'workspace:~') {
54+
packageJSON.dependencies[key] = dependenciesVersion
55+
}
56+
})
57+
}
58+
4659
fs.writeFileSync(packagesPath, JSON.stringify(packageJSON, null, 2) + '\n')
4760
} else {
4861
fs.writeFileSync(packagesPath, result)
@@ -73,7 +86,8 @@ export const releaseAlpha = ({ updateVersion }) => {
7386
'theme-mobile/dist',
7487
'theme-saas/dist',
7588
'utils',
76-
'vue-hooks'
89+
'vue-hooks',
90+
'vue-runtime'
7791
]
7892
distLists.forEach((item) => {
7993
findAllpage(pathFromPackages(item), updateVersion)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"pub:runtime": "pnpm --filter=\"./packages/vue-runtime/\" publish --no-git-checks --access=public",
7979
"pub:utils": "pnpm --filter=\"./packages/utils/\" publish --no-git-checks --access=public",
8080
"pub:hooks": "pnpm --filter=\"./packages/vue-hooks/\" publish --no-git-checks --access=public",
81-
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeSaas && pnpm pub:renderless && pnpm pub:runtime",
81+
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeSaas && pnpm pub:renderless",
8282
"pub:site": "pnpm -C examples/sites pub",
8383
"// ---------- 自动化发测试包 ----------": "",
8484
"auto-build-pub": "pnpm -C internals/automate auto-build-pub",

0 commit comments

Comments
 (0)