Просмотр исходного кода

update version to 1.1, make master latest

Daniel Zlotin 7 лет назад
Родитель
Сommit
754b1d5302
2 измененных файлов: 13 добавлений и 8 удалений
  1. 1
    1
      package.json
  2. 12
    7
      scripts/release.js

+ 1
- 1
package.json Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "react-native-navigation",
3
-  "version": "2.0.0-experimental.0",
3
+  "version": "1.1.0",
4 4
   "description": "React Native Navigation - truly native navigation for iOS and Android",
5 5
   "license": "MIT",
6 6
   "nativePackage": true,

+ 12
- 7
scripts/release.js Просмотреть файл

@@ -3,15 +3,15 @@ const p = require('path');
3 3
 const semver = require('semver');
4 4
 
5 5
 function execSync(cmd) {
6
-  cp.execSync(cmd, {stdio: ['inherit', 'inherit', 'inherit']});
6
+  cp.execSync(cmd, { stdio: ['inherit', 'inherit', 'inherit'] });
7 7
 }
8 8
 
9 9
 function execSyncRead(cmd) {
10
-  return String(cp.execSync(cmd, {stdio: ['inherit', 'pipe', 'inherit']})).trim();
10
+  return String(cp.execSync(cmd, { stdio: ['inherit', 'pipe', 'inherit'] })).trim();
11 11
 }
12 12
 
13 13
 function execSyncSilently(cmd) {
14
-  cp.execSync(cmd, {stdio: ['ignore', 'ignore', 'ignore']});
14
+  cp.execSync(cmd, { stdio: ['ignore', 'ignore', 'ignore'] });
15 15
 }
16 16
 
17 17
 function validateEnv() {
@@ -42,9 +42,14 @@ function setupGit() {
42 42
 }
43 43
 
44 44
 function calcNewVersion() {
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');
45
+  const latestVersion = execSyncRead(`npm view ${process.env.npm_package_name}@latest version`);
46
+  console.log(`latest version is: ${latestVersion}`);
47
+  console.log(`package version is: ${process.env.npm_package_version}`);
48
+  if (semver.gt(process.env.npm_package_version, latestVersion)) {
49
+    return semver.inc(process.env.npm_package_version, 'patch');
50
+  } else {
51
+    return semver.inc(latestVersion, 'patch');
52
+  }
48 53
 }
49 54
 
50 55
 function copyNpmRc() {
@@ -56,7 +61,7 @@ function tagAndPublish(newVersion) {
56 61
   console.log(`new version is: ${newVersion}`);
57 62
   execSync(`npm version ${newVersion} -m "v${newVersion} [ci skip]"`);
58 63
   execSyncSilently(`git push deploy --tags`);
59
-  execSync(`npm publish --tag next`);
64
+  execSync(`npm publish --tag latest`);
60 65
 }
61 66
 
62 67
 function run() {