@@ -8,28 +8,28 @@ async function main() {
8
8
9
9
console . log ( 'release: v' + version ) ;
10
10
11
- // // at dev branch
12
- // if ((await x('git branch --show-current')) !== 'dev') {
13
- // console.log(`x('git branch --show-current') !== 'dev'`);
14
- // return;
15
- // }
16
-
17
- // // working tree is clean
18
- // if ((await x('git status --porcelain')) !== '') {
19
- // console.log(`x('git status --porcelain') !== ''`);
20
- // return;
21
- // }
22
-
23
- // // rebase & merge
24
- // await sh('git rebase -i main');
25
- // await sh('git checkout main');
26
- // await sh('git merge dev');
11
+ // at dev branch
12
+ if ( ( await x ( 'git branch --show-current' ) ) !== 'dev' ) {
13
+ console . log ( `x('git branch --show-current') !== 'dev'` ) ;
14
+ return ;
15
+ }
16
+
17
+ // working tree is clean
18
+ if ( ( await x ( 'git status --porcelain' ) ) !== '' ) {
19
+ console . log ( `x('git status --porcelain') !== ''` ) ;
20
+ return ;
21
+ }
22
+
23
+ // rebase & merge
24
+ await sh ( 'git rebase -i main' ) ;
25
+ await sh ( 'git checkout main' ) ;
26
+ await sh ( 'git merge dev' ) ;
27
27
28
28
// build & test
29
29
await fs . remove ( './build' ) ;
30
30
await sh ( 'tsc -p tsconfig.cjs.json' ) ;
31
31
await sh ( 'tsc -p tsconfig.esm.json' ) ;
32
- // await sh('jest ');
32
+ await sh ( 'yarn test ' ) ;
33
33
34
34
// we can use path-nice now
35
35
const path = require ( '../build/cjs/index.cjs.js' ) ;
@@ -44,21 +44,21 @@ async function main() {
44
44
// generate CHANGLOG.md
45
45
await sh ( 'conventional-changelog -p angular -i CHANGELOG.md -s' ) ;
46
46
47
- // // commit, back to dev branch, tag
48
- // await sh('git add -A');
49
- // await sh(`git commit -m "chore: release ${version}"`);
50
- // await sh(`git tag v${version}`);
51
- // await sh('git checkout dev');
52
- // await sh('git merge main');
53
-
54
- // // sync
55
- // await sh('git push --all');
56
- // await sh(`git push origin v${version}`);
57
-
58
- // console.log(chalk.red(`Critical operation:`));
59
- // console.log(chalk.red(` $ npm publish --dry-run ./release`));
60
- // console.log(chalk.red(` $ npm publish ./release`));
61
- // console.log(chalk.red(`Copy the command and execute it yourself.`));
47
+ // commit, back to dev branch, tag
48
+ await sh ( 'git add -A' ) ;
49
+ await sh ( `git commit -m "chore: release ${ version } "` ) ;
50
+ await sh ( `git tag v${ version } ` ) ;
51
+ await sh ( 'git checkout dev' ) ;
52
+ await sh ( 'git merge main' ) ;
53
+
54
+ // sync
55
+ await sh ( 'git push --all' ) ;
56
+ await sh ( `git push origin v${ version } ` ) ;
57
+
58
+ console . log ( chalk . red ( `Critical operation:` ) ) ;
59
+ console . log ( chalk . red ( ` $ npm publish --dry-run ./release` ) ) ;
60
+ console . log ( chalk . red ( ` $ npm publish ./release` ) ) ;
61
+ console . log ( chalk . red ( `Copy the command and execute it yourself.` ) ) ;
62
62
}
63
63
64
64
function getInput ( ) {
0 commit comments