1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-02-02 18:20:26 +08:00

feat: 新增release发布脚本

This commit is contained in:
chufan
2023-09-05 09:48:50 +08:00
parent 42934f96d9
commit d94f30aa20
7 changed files with 130 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
// commit-and-tag-version 配置参考https://github.com/conventional-changelog/standard-version
module.exports={
"header": "# Change Log\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n<!-- #region recent-beta -->\n",
"header": "# Release history\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n<!-- #region recent-beta -->\n",
"releaseCommitMessageFormat": "chore(release): publish v{{currentTag}}",
"types": [
{ "type": "feat", "section": "Features" },

View File

@@ -22,12 +22,10 @@
"deploy:ali": "bash scripts/deploy.sh ali $npm_package_version",
"deploy:github": "bash scripts/page_deploy.sh",
"deploy:vercel": "vercel --prod",
"version:alpha": "npm version prerelease --preid alpha",
"version:patch": "npm version patch",
"release": "bumpp --preid alpha --execute=\"pnpm commit-and-tag-version && git add CHANGELOG.md\" --commit \"chore(release): publish v%s\" --all --tag --push",
"lint": "eslint --ext .js,.vue,.ts --ignore-path .gitignore .",
"lintfix": "eslint --fix --ext .js,.ts,.vue --ignore-path .gitignore .",
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + ",
"release": "bumpp --preid alpha --execute=\"pnpm commit-and-tag-version && git add CHANGELOG.md\" --commit \"chore(release): publish v%s\" --all --tag --push"
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + "
},
"scripts-info": {
"prepare": "安装依赖预执行脚本",
@@ -38,19 +36,20 @@
"image:faster": "本地build后快速构建镜像",
"deploy:ali": "部署到阿里云服务器",
"deploy:github": "部署到github平台集成ci",
"version:alpha": "alpha测试版号更新基于next分之操作",
"release": "alpha测试版号更新、正式版本发布",
"version:patch": "稳定版号更新基于master分支操作",
"lint": "eslint校验代码指出异常",
"lintfix": "格式化代码,自动化处理异常",
"clean": "快速删除本地依赖"
},
"devDependencies": {
"commit-and-tag-version": "11.2.3",
"bumpp": "^9.2.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vuepress/client": "2.0.0-beta.61",
"@vuepress/utils": "2.0.0-beta.61",
"bumpp": "^9.2.0",
"commit-and-tag-version": "11.2.3",
"enquirer": "^2.4.1",
"eslint": "^8.48.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
@@ -65,5 +64,8 @@
"vuepress-plugin-search-pro": "2.0.0-beta.185",
"vuepress-theme-hope": "2.0.0-beta.185"
},
"license": "MIT"
"license": "MIT",
"dependencies": {
"shelljs": "^0.8.5"
}
}

58
pnpm-lock.yaml generated
View File

@@ -7,6 +7,7 @@ specifiers:
'@vuepress/utils': 2.0.0-beta.61
bumpp: ^9.2.0
commit-and-tag-version: 11.2.3
enquirer: ^2.4.1
eslint: ^8.48.0
eslint-config-standard: ^17.1.0
eslint-plugin-import: ^2.28.1
@@ -14,6 +15,7 @@ specifiers:
eslint-plugin-promise: ^6.1.1
eslint-plugin-vue: ^9.17.0
husky: ^8.0.3
shelljs: ^0.8.5
typescript: ^3.9.10
vercel: ^32.1.0
vue: ^3.3.4
@@ -21,6 +23,9 @@ specifiers:
vuepress-plugin-search-pro: 2.0.0-beta.185
vuepress-theme-hope: 2.0.0-beta.185
dependencies:
shelljs: 0.8.5
devDependencies:
'@typescript-eslint/eslint-plugin': 5.62.0_t35iirz4jglssjgh62faxwrgja
'@typescript-eslint/parser': 5.62.0_vrcbyn5545yca3bsdhml4elxx4
@@ -28,6 +33,7 @@ devDependencies:
'@vuepress/utils': 2.0.0-beta.61
bumpp: 9.2.0
commit-and-tag-version: 11.2.3
enquirer: 2.4.1
eslint: 8.48.0
eslint-config-standard: 17.1.0_r3lmx5iihil3gzlcgokhppzyfu
eslint-plugin-import: 2.28.1_ean2qamlavtp6bo3zeco4caumq
@@ -2979,6 +2985,11 @@ packages:
uri-js: 4.4.1
dev: true
/ansi-colors/4.1.3:
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
engines: {node: '>=6'}
dev: true
/ansi-regex/5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
@@ -3221,7 +3232,6 @@ packages:
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: true
/balloon-css/1.2.0:
resolution: {integrity: sha512-urXwkHgwp6GsXVF+it01485Z2Cj4pnW02ICnM0TemOlkKmCNnDLmyy+ZZiRXBpwldUXO+aRNr7Hdia4CBvXJ5A==}
@@ -3286,7 +3296,6 @@ packages:
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
dev: true
/brace-expansion/2.0.1:
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
@@ -3628,7 +3637,6 @@ packages:
/concat-map/0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
dev: true
/concat-stream/2.0.0:
resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==}
@@ -4504,6 +4512,14 @@ packages:
resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==}
dev: true
/enquirer/2.4.1:
resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==}
engines: {node: '>=8.6'}
dependencies:
ansi-colors: 4.1.3
strip-ansi: 6.0.1
dev: true
/entities/3.0.1:
resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==}
engines: {node: '>=0.12'}
@@ -5354,7 +5370,6 @@ packages:
/fs.realpath/1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
dev: true
/fsevents/2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
@@ -5366,7 +5381,6 @@ packages:
/function-bind/1.1.1:
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
dev: true
/function.prototype.name/1.1.6:
resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==}
@@ -5542,7 +5556,6 @@ packages:
minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
dev: true
/globals/11.12.0:
resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
@@ -5680,7 +5693,6 @@ packages:
engines: {node: '>= 0.4.0'}
dependencies:
function-bind: 1.1.1
dev: true
/hash-sum/2.0.0:
resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==}
@@ -5801,11 +5813,9 @@ packages:
dependencies:
once: 1.4.0
wrappy: 1.0.2
dev: true
/inherits/2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
dev: true
/ini/1.3.8:
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
@@ -5836,6 +5846,11 @@ packages:
engines: {node: '>=12'}
dev: true
/interpret/1.4.0:
resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==}
engines: {node: '>= 0.10'}
dev: false
/is-alphabetical/1.0.4:
resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==}
dev: true
@@ -5889,7 +5904,6 @@ packages:
resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==}
dependencies:
has: 1.0.3
dev: true
/is-date-object/1.0.5:
resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
@@ -6746,7 +6760,6 @@ packages:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
dev: true
/minimatch/5.1.6:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
@@ -7013,7 +7026,6 @@ packages:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: true
/onetime/5.1.2:
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
@@ -7181,7 +7193,6 @@ packages:
/path-is-absolute/1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
dev: true
/path-key/3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
@@ -7195,7 +7206,6 @@ packages:
/path-parse/1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
dev: true
/path-to-regexp/6.1.0:
resolution: {integrity: sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw==}
@@ -7462,6 +7472,13 @@ packages:
picomatch: 2.3.1
dev: true
/rechoir/0.6.2:
resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==}
engines: {node: '>= 0.10'}
dependencies:
resolve: 1.22.4
dev: false
/redent/3.0.0:
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
engines: {node: '>=8'}
@@ -7563,7 +7580,6 @@ packages:
is-core-module: 2.13.0
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
dev: true
/restore-cursor/4.0.0:
resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==}
@@ -7749,6 +7765,16 @@ packages:
engines: {node: '>=8'}
dev: true
/shelljs/0.8.5:
resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==}
engines: {node: '>=4'}
hasBin: true
dependencies:
glob: 7.2.3
interpret: 1.4.0
rechoir: 0.6.2
dev: false
/side-channel/1.0.4:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
dependencies:
@@ -8023,7 +8049,6 @@ packages:
/supports-preserve-symlinks-flag/1.0.0:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
dev: true
/tar/6.1.15:
resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==}
@@ -9599,7 +9624,6 @@ packages:
/wrappy/1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: true
/xml-js/1.6.11:
resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==}

36
scripts/.exec Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env node
const {join} = require('path')
const cwd = join(__dirname, '..')
process.env.PATH = `${join(cwd, 'node_modules', '.bin')}:${process.env.PATH}`
const {exec,exit} = require('shelljs');
/**
* 监听进程
* - 退出进程
*/
process.on('exit', () => {
exit()
})
/**
* 执行shell指令
* @param commands
*/
exports.execShell = commands => {
let runCommands=[]
if(typeof commands ==='string'){
runCommands.push(commands)
}
// 批量执行
if(Array.isArray(commands)){
runCommands=commands
}
for (const command of runCommands) {
console.log(`------- command: >>> ${command} <<< start -------`)
exec(command)
console.log(`------- command: >>> ${command} <<< ending -------`)
}
}

8
scripts/build Normal file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env node
const {execShell} = require("./.exec");
const inquirer = require('inquirer');
(async ()=>{
await execShell(['pnpm build','pnpm build:proxy'])
})()

27
scripts/release Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env node
/**
* 版本发布脚本
* 链接https://jstools.dev/version-bump-prompt/
* 使用: ./scripts/release
*/
const {execShell} = require("./.exec");
// 利用commit-and-tag-version生成changelog文档并跳过commit、tag操作
const generateChangeLog='pnpm commit-and-tag-version && git add CHANGELOG.md'
// git提交信息
const commitInfo='chore(release): publish v%s'
const releaseCommands=
"bumpp " +
"--preid alpha "+
`--execute= "${generateChangeLog}" `+
`--commit "${commitInfo}" `+
"--all "+
"--tag "+
"--push "
;(async ()=>{
await execShell(releaseCommands)
})()

7
scripts/test Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env node
const {execShell} = require("./.exec");
(async ()=>{
await execShell(['pnpm build','pnpm build:proxy'])
})()