ci: 优化 pre-commit
parent
2793dd8b5e
commit
30c3503b22
10
package.json
10
package.json
|
@ -73,7 +73,7 @@
|
||||||
"vitest": "^0.29.7"
|
"vitest": "^0.29.7"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"pre-commit": "pnpm lint-staged",
|
"pre-commit": "pnpm lint-staged && pnpm test && pnpm build -a",
|
||||||
"commit-msg": "pnpm commitlint --edit $1"
|
"commit-msg": "pnpm commitlint --edit $1"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -82,7 +82,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.(j|t)s": "pnpm lint:fix"
|
"*.{js,json}": [
|
||||||
|
"prettier --write"
|
||||||
|
],
|
||||||
|
"*.ts?(x)": [
|
||||||
|
"eslint",
|
||||||
|
"prettier --parser=typescript --write"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"peerDependencyRules": {
|
"peerDependencyRules": {
|
||||||
|
|
|
@ -22,13 +22,13 @@ async function main() {
|
||||||
|
|
||||||
consola.info('Git add');
|
consola.info('Git add');
|
||||||
exec('git add .');
|
exec('git add .');
|
||||||
|
exec(`git commit -m "chore: release v${version}"`);
|
||||||
|
exec(`git tag -a v${version} -m "v${version}"`);
|
||||||
|
|
||||||
consola.info('Git push');
|
consola.info('Git push');
|
||||||
exec(`git commit -m "chore: release v${version}"`);
|
|
||||||
exec('git push');
|
exec('git push');
|
||||||
|
|
||||||
consola.info('Git push tag');
|
consola.info('Git push tag');
|
||||||
exec(`git tag -a v${version} -m "v${version}"`);
|
|
||||||
exec(`git push origin v${version}`);
|
exec(`git push origin v${version}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue