From 8a7d96f6caa4f50d84a040bdca6f045635b9efb8 Mon Sep 17 00:00:00 2001 From: shuisheng <2274751790@qq.com> Date: Thu, 29 Sep 2022 04:53:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/publish.js | 8 +++++--- scripts/release.js | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/publish.js b/scripts/publish.js index 27975cbd..05403ab7 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -8,6 +8,10 @@ const { chalkINFO, } = require('../build-tools/utils/chalkTip'); +// 如果进程超时或有非零退出代码,execSync将抛出Error 对象 +execSync(`git push origin v${pkg.version}`, { stdio: 'inherit' }); +execSync(`git push`, { stdio: 'inherit' }); + const packages = fs.readdirSync(path.resolve(__dirname, '../packages/')); packages.forEach((res) => { const stat = fs.statSync(`${path.resolve(__dirname, '../packages/')}/${res}`); @@ -16,9 +20,7 @@ packages.forEach((res) => { console.log( chalkINFO(`开始发布线上@huangshuisheng/${res}@${pkg.version}...`) ); - // 如果进程超时或有非零退出代码,execSync将抛出Error 对象 - execSync(`git push origin v${pkg.version}`, { stdio: 'inherit' }); - execSync(`git push`, { stdio: 'inherit' }); + execSync('npm publish --access public', { stdio: 'inherit', cwd: path.resolve(__dirname, '../packages', res, 'dist'), diff --git a/scripts/release.js b/scripts/release.js index 048f08eb..d98f3282 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -60,6 +60,9 @@ const selectReleaseVersion = async () => { // 更新package.json updatePackageJSON(); + execSync(`npm run compile:svg`, { stdio: 'inherit' }); + execSync(`npm run compile:vue`, { stdio: 'inherit' }); + // 生成changelog execSync(`npm run changelog`, { stdio: 'inherit' });