|
@@ -42,16 +42,9 @@ function setupGit() {
|
42
|
42
|
}
|
43
|
43
|
|
44
|
44
|
function calcNewVersion() {
|
45
|
|
- const latestVersion = execSyncRead(`npm view ${process.env.npm_package_name}@next version`);
|
46
|
|
- console.log(`latest version is: ${latestVersion}`);
|
47
|
|
- const packageJsonVersion = process.env.npm_package_version;
|
48
|
|
- console.log(`package.json version is: ${packageJsonVersion}`);
|
49
|
|
- const diff = semver.diff(packageJsonVersion, latestVersion);
|
50
|
|
- if (diff === 'major' || diff === 'minor') {
|
51
|
|
- return packageJsonVersion;
|
52
|
|
- } else {
|
53
|
|
- return semver.inc(latestVersion, 'patch');
|
54
|
|
- }
|
|
45
|
+ const nextTaggedVersion = execSyncRead(`npm view ${process.env.npm_package_name}@next version`);
|
|
46
|
+ console.log(`next tagged version is: ${nextTaggedVersion}`);
|
|
47
|
+ return semver.inc(nextTaggedVersion, 'prerelease');
|
55
|
48
|
}
|
56
|
49
|
|
57
|
50
|
function copyNpmRc() {
|
|
@@ -63,7 +56,7 @@ function tagAndPublish(newVersion) {
|
63
|
56
|
console.log(`new version is: ${newVersion}`);
|
64
|
57
|
execSync(`npm version ${newVersion} -m "v${newVersion} [ci skip]"`);
|
65
|
58
|
execSyncSilently(`git push deploy --tags`);
|
66
|
|
- execSync(`npm publish`);
|
|
59
|
+ execSync(`npm publish --tag next`);
|
67
|
60
|
}
|
68
|
61
|
|
69
|
62
|
function run() {
|
|
@@ -76,4 +69,3 @@ function run() {
|
76
|
69
|
}
|
77
|
70
|
|
78
|
71
|
run();
|
79
|
|
-
|