File tree Expand file tree Collapse file tree 4 files changed +47
-21
lines changed Expand file tree Collapse file tree 4 files changed +47
-21
lines changed Original file line number Diff line number Diff line change
1
+ env :
2
+ global :
3
+ - DATE=$(date +%Y-%m-%d)
4
+ - PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
5
+ - NATIVESCRIPT_SKIP_POSTINSTALL_TASKS=1
1
6
language : node_js
2
7
node_js :
3
8
- ' 4'
4
- before_install :
9
+ git :
10
+ submodules : false
11
+ before_script :
5
12
-
sed -i 's/[email protected] :/https:\/\/github.com\//' .gitmodules
6
13
- git submodule update --init --recursive
7
- - npm install -g grunt-cli
8
- install :
14
+ - npm install grunt
15
+ - node_modules/.bin/grunt enableScripts:false
9
16
- npm install
10
- - grunt pack --no-color
11
- script :
12
17
- npm test
13
- git :
14
- submodules : false
18
+ - node_modules/.bin/grunt enableScripts:true
19
+ script :
20
+ - node_modules/.bin/grunt lint
21
+ - node_modules/.bin/grunt pack --no-color
22
+ before_deploy :
23
+ - node .travis/add-publishConfig.js next
15
24
deploy :
16
- - provider : releases
17
25
skip_cleanup : true
18
- api_key :
19
- secure : eUmm52zfs68StxqUkPWuuNa85vBrlYmjuRw4FR8kZSyBWKkCySU8xuZVRpxLdqE3VRAsORsP2Ggf4UKqDM4BtTNl0lZGLeyT2OuL/9AB1r/IqzylLI2xAmibboLktFL4BQL8uqWnBkyYHSC0Ufv7C8poXdbyubLrSMuP9hRBy/0=
20
- file : travis/nativescript.tgz
21
- on :
22
- tags : true
23
- all_branches : true
24
- - provider : npm
26
+ provider : npm
25
27
26
- api_key :
27
- secure : KISJen/tS+355itLT6eI5rBAwL9utOLDT1l8z6dJKLdt24l9LvKxhHlYI/WOCVPvNCUQ8cQAqGcVgmD+SmTpoCkBAHMml3C/zGZSwYd6Km1/1Eu0JtodbtLjLaTaPYpU+I7Z2bC6eFdb8hIrFEZhf92oQAyLCgBQJpu3ECjxXgI=
28
28
on :
29
- tags : true
30
- all_branches : true
29
+ branch : master
30
+ api_key :
31
+ secure : Ugq6m/y4P5gF15zffYzTKhusn1Csu3ymYLdD+yXgyK3hek9Ms5PKTz4MKgPinlViRCBoQV2fGh0JsCikawIpmQyD+M+FRDKlP2GcXPhFmSN1wVEloxTCwe7H6m7Kl9mo+MJOTS0BN7waCc6yTJBJPxo5nwFgz+DT2srIYndA2h4=
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ var fsModule = require ( 'fs' ) ;
4
+
5
+ //Adds a publishConfig section to the package.json file
6
+ // and sets a tag to it
7
+
8
+ var path = './package.json' ;
9
+ var fileOptions = { encoding : "utf-8" } ;
10
+ var content = fsModule . readFileSync ( path , fileOptions ) ;
11
+
12
+ var tag = process . argv [ 2 ] ;
13
+ if ( ! tag ) {
14
+ console . log ( 'Please pass the tag name as an argument!' ) ;
15
+ process . exit ( 1 ) ;
16
+ }
17
+
18
+ var packageDef = JSON . parse ( content ) ;
19
+ if ( ! packageDef . publishConfig ) {
20
+ packageDef . publishConfig = { } ;
21
+ }
22
+ packageDef . publishConfig . tag = tag ;
23
+
24
+ var newContent = JSON . stringify ( packageDef , null , ' ' ) ;
25
+ fsModule . writeFileSync ( path , newContent , fileOptions ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function shallowCopy(obj) {
9
9
}
10
10
11
11
var travis = process . env [ "TRAVIS" ] ;
12
- var buildNumber = process . env [ "TRAVIS_BUILD_NUMBER " ] || process . env [ "BUILD_NUMBER" ] || "non-ci" ;
12
+ var buildNumber = process . env [ "PACKAGE_VERSION " ] || process . env [ "BUILD_NUMBER" ] || "non-ci" ;
13
13
14
14
module . exports = function ( grunt ) {
15
15
var path = require ( "path" ) ;
Original file line number Diff line number Diff line change 102
102
"engines" : {
103
103
"node" : " >=0.10.40 <0.11.0 || >=0.12.7 <0.13.0 || >=4.2.1 <5.0.0 || >=5.1.0 <7.0.0"
104
104
}
105
- }
105
+ }
You can’t perform that action at this time.
0 commit comments