File tree 5 files changed +71
-4
lines changed
5 files changed +71
-4
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,20 @@ matrix:
35
35
- OPENSSL_DIR=""
36
36
before_install :
37
37
- sudo apt-get install -y haveged
38
+ - if [ "$TRAVIS_BRANCH" == "master" ]; then
39
+ git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
40
+ cd "$TRAVIS_REPO_SLUG";
41
+ git checkout -qf "$TRAVIS_COMMIT";
42
+ fi
38
43
before_script :
39
44
- npm prune
40
- - sudo haveged -w 4096
45
+ - sudo haveged -w 2048
41
46
script :
42
- - if [[ "$OPENSSL_DIR" != "" ]]; then "./test_build_openssl.sh" ; fi
47
+ - if [[ "$OPENSSL_DIR" != "" ]]; then "./bin/ test_build_openssl.sh" ; fi
43
48
- npm run test
44
49
after_success :
45
- - npm run semantic-release
50
+ - if [ "$TRAVIS_NODE_VERSION" == "8" ]; then npm run aftersuccess ; fi
51
+ - if [ "$TRAVIS_BRANCH" == "master" ]; then npm run semantic-release ; fi
46
52
branches :
47
53
except :
48
54
- /^v\d+\.\d+\.\d+$/
Original file line number Diff line number Diff line change
1
+ const deployOnce = require ( '../node_modules/travis-deploy-once' )
2
+
3
+ const makeTest = async function ( ) {
4
+ let result
5
+
6
+ try {
7
+ // Options can also be set as environment variables with the same name
8
+ result = await deployOnce (
9
+ {
10
+ // Object passed to https://github.com/pwmckenna/node-travis-ci
11
+ travisOpts : { pro : false } ,
12
+ // GitHub oAuth token
13
+ GH_TOKEN : process . env . GH_TOKEN ,
14
+ // Want to control which job is the build leader?
15
+ // Set your preferred job id
16
+ BUILD_LEADER_ID : 1
17
+ }
18
+ )
19
+ } catch ( err ) {
20
+ // something went wrong, and err will tell you what
21
+ console . log ( err )
22
+ }
23
+
24
+ if ( result === true ) {
25
+ process . exitCode = 0
26
+ console . log ( 0 )
27
+ }
28
+ if ( result === false ) {
29
+ process . exitCode = 1
30
+ console . log ( 1 )
31
+ }
32
+ if ( result === null ) {
33
+ process . exitCode = 1
34
+ console . log ( 1 )
35
+ }
36
+ return 0
37
+ }
38
+
39
+ makeTest ( )
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ OUTPUT=$( node " $( pwd) /bin/aftersuccess.js" )
5
+ STATUS=$?
6
+
7
+ echo " ${STATUS} ${OUTPUT} "
8
+
9
+ if [[ " ${STATUS} " == " 0" ]]
10
+ then
11
+ git config --global user.name " Dexus via TravisCI"
12
+ git config --global user.email
" [email protected] "
13
+ git config credential.helper " store --file=.git/credentials"
14
+ echo " https://$GH_TOKEN :@github.com" > .git/credentials
15
+ git checkout " $TRAVIS_BRANCH "
16
+ npm run changelog
17
+ git add HISTORY.md
18
+ git commit -m " Update HISTORY.md via TravisCI" -m " [ci skip]"
19
+ git push
20
+ fi
File renamed without changes.
Original file line number Diff line number Diff line change 17
17
},
18
18
"main" : " lib/pem" ,
19
19
"scripts" : {
20
+ "aftersuccess" : " bin/aftersuccess.sh" ,
20
21
"documentation" : " npm run docco --silent && npm run jsdoc --silent" ,
21
22
"docco" : " docco -l parallel -o docs/docco lib/helper.js lib/openssl.js lib/pem.js" ,
22
23
"jsdoc" : " jsdoc -c jsdoc.json" ,
60
61
"jsdoc" : " ^3.5.5" ,
61
62
"mocha" : " ^4.0.1" ,
62
63
"nyc" : " ^11.2.1" ,
63
- "semantic-release" : " ^8.1.1"
64
+ "semantic-release" : " ^8.1.1" ,
65
+ "travis-deploy-once" : " ^3.0.0"
64
66
},
65
67
"engines" : {
66
68
"node" : " >=4.0.0"
You can’t perform that action at this time.
0 commit comments