Skip to content

Commit dc25cc1

Browse files
author
Vasil Chimev
authored
chore(travis): do not publish next version (NativeScript#875)
Publish next version from Jenkins CI.
1 parent 03a2ad7 commit dc25cc1

File tree

4 files changed

+33
-72
lines changed

4 files changed

+33
-72
lines changed

.travis.yml

-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
env:
22
global:
33
- NODE_VERSION=6.9.1
4-
- DATE=$(date +%Y-%m-%d)
5-
- PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
64
- EMULATOR_API_LEVEL=19
75
- ANDROID_VERSION=23
86
- ANDROID_BUILD_TOOLS_VERSION=23.0.1
@@ -47,17 +45,3 @@ script:
4745
- tns build android
4846
- android-wait-for-emulator
4947
- npm run appium --runtype=android19 --appium=$APPIUM_VERSION
50-
before_deploy:
51-
- cd ../nativescript-angular
52-
- npm install -g nativescript --ignore-scripts
53-
- tns usage-reporting disable
54-
- tns error-reporting disable
55-
- node ../build/travis-scripts/add-publishConfig.js next $PACKAGE_VERSION
56-
deploy:
57-
provider: npm
58-
59-
skip_cleanup: true
60-
api_key:
61-
secure: J88MqLAoZStZZ77AAf+wgaoZp+8zG3fOUHRneSe4x/yEzyUShS9SlGuq0TSkm9sJVX94iHJl1BQ4yjLshOPV9dkOg1+BB4PbsDTKPCAhPCZgpW7WKz6iImmuWHArchLIRtI1fp+UYi1+V6c7gLALQPY7qR2QJcDJdq1tdgORAyGySMis95ttVhnn6DWTBbs/ocu+IzgOyBSkIiZR0mGk7q/pmVQPy+XL5PQoyUOhD4MmvAAIeVr+XoZ5I8pAUwhi1/bZijXrzWe7LbXh8pTDlEWvYduzYYjJZqUrHiE/e1e8/DIPXGaBUQBj7LRxSqqO8AJXGeCg4DF1R9j4CSG5c0pAwQ/U6vOGu8duPEGaoKG5+HlrTav7gI/YbwFA5HKyh1uzQ5trZDJ4mMKUoB1+8/eL2cjLudtyBB2Kg28wH6f78A9mQC1EJcP7Jz3qJTSUyhczIvwSF8/EkD8xmeaoTi2e+4TNgf7pys1cp6c7m7zKZbvVy25lfyAfG1rCF5+rzKj+GnE9mtLaY6VvlKWjyxklh8hfRBC94TZ8K7PH0tmdgk2Jal+OCdm9FDdmNrBSC1G/gPS8PchtffIRprPhNAUfcVpdg0rlQ4dckbGRbB5UBgwHkpoKasaSTx/nO85AiK6USIYOIod19loXUBvN3QyHUX76w265UhmTnb8iojo=
62-
on:
63-
branch: master

build/generate-value-accessor-selector.js

-23
This file was deleted.

build/prepublish-next.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
const fs = require("fs");
3+
const path = require("path");
4+
5+
const getPackageJson = projectDir => {
6+
const packageJsonPath = getPackageJsonPath(projectDir);
7+
return JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
8+
};
9+
10+
const writePackageJson = (content, projectDir) => {
11+
const packageJsonPath = getPackageJsonPath(projectDir);
12+
fs.writeFileSync(packageJsonPath, JSON.stringify(content, null, 2))
13+
}
14+
15+
const getPackageJsonPath = projectDir => path.resolve(projectDir, "package.json");
16+
17+
const tag = "next";
18+
const projectDir = "nativescript-angular";
19+
const packageJson = getPackageJson(projectDir);
20+
const [, , packageVersion = new Date() ] = process.argv;
21+
22+
packageJson.publishConfig = Object.assign(
23+
packageJson.publishConfig || {},
24+
{ tag }
25+
);
26+
27+
delete packageJson.private;
28+
29+
const currentVersion = packageJson.version;
30+
const nextVersion = `${currentVersion}-${packageVersion}`;
31+
const newPackageJson = Object.assign(packageJson, { version: nextVersion });
32+
33+
writePackageJson(newPackageJson, projectDir);

build/travis-scripts/add-publishConfig.js

-33
This file was deleted.

0 commit comments

Comments
 (0)