Browse Source

update version to 1.1, make master latest

Daniel Zlotin 7 years ago
parent
commit
754b1d5302
2 changed files with 13 additions and 8 deletions
  1. 1
    1
      package.json
  2. 12
    7
      scripts/release.js

+ 1
- 1
package.json View File

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

+ 12
- 7
scripts/release.js View File

3
 const semver = require('semver');
3
 const semver = require('semver');
4
 
4
 
5
 function execSync(cmd) {
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
 function execSyncRead(cmd) {
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
 function execSyncSilently(cmd) {
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
 function validateEnv() {
17
 function validateEnv() {
42
 }
42
 }
43
 
43
 
44
 function calcNewVersion() {
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
 function copyNpmRc() {
55
 function copyNpmRc() {
56
   console.log(`new version is: ${newVersion}`);
61
   console.log(`new version is: ${newVersion}`);
57
   execSync(`npm version ${newVersion} -m "v${newVersion} [ci skip]"`);
62
   execSync(`npm version ${newVersion} -m "v${newVersion} [ci skip]"`);
58
   execSyncSilently(`git push deploy --tags`);
63
   execSyncSilently(`git push deploy --tags`);
59
-  execSync(`npm publish --tag next`);
64
+  execSync(`npm publish --tag latest`);
60
 }
65
 }
61
 
66
 
62
 function run() {
67
 function run() {