File tree Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 8
8
! .babelrc
9
9
! .travis.yml
10
10
! .eslintrc
11
+ ! .scripts
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -ev
3
+
4
+ if [[ $TRAVIS_PULL_REQUEST = " true" ]]; then
5
+ echo ' This is a pull request. Exiting the release script.'
6
+
7
+ exit 0
8
+ fi
9
+
10
+ if [[ $TRAVIS_BRANCH = " master" ]]; then
11
+ echo ' This is not a master branch. Exiting the release script.'
12
+
13
+ exit 0
14
+ fi
15
+
16
+ if [[ $TRAVIS_TAG != " " ]]; then
17
+ echo ' This is a tag release.'
18
+
19
+ # Use NPM_TOKEN to enable NPM authentication
20
+ echo " //registry.npmjs.org/:_authToken=${NPM_TOKEN} " > ~ /.npmrc
21
+
22
+ NODE_ENV=development npm install
23
+ NODE_ENV=production npm run build
24
+
25
+ npm publish
26
+ exit 0
27
+ fi
28
+
29
+ if [[ $( git log --format=%B -n 1 $TRAVIS_COMMIT ) == * " chore: release" * ]]; then
30
+ echo ' This is a tag release. Exiting the release script.'
31
+
32
+ exit 0
33
+ fi ;
34
+
35
+ git config --global user.name ' continuous-deployment'
36
+ git config --global user.email ' continuous-deployment@travis'
37
+
38
+ # Use GITHUB_TOKEN to enable GitHub authentication
39
+ git config credential.helper " store --file=.git/credentials"
40
+ echo " https://${GITHUB_TOKEN} :@github.com" > .git/credentials
41
+
42
+ git checkout master
43
+ git merge $TRAVIS_COMMIT
44
+
45
+ # 1. bump the package.json version (based on your commit history)
46
+ # 2. update CHANGELOG.md
47
+ # 3. commit package.json and CHANGELOG.md
48
+ # 4. tag the release
49
+ standard-version --message " chore: release %s"
50
+
51
+ git push --follow-tags origin master
Original file line number Diff line number Diff line change 9
9
- npm run test
10
10
- npm run lint
11
11
- npm run build
12
+ after_success :
13
+ - travis-after-all && ./.scripts/release.sh
Original file line number Diff line number Diff line change 34
34
"create-index" : " 0.1.3" ,
35
35
"eslint" : " ^3.3.1" ,
36
36
"eslint-config-canonical" : " ^1.7.16" ,
37
- "mocha" : " ^3.0.2"
37
+ "mocha" : " ^3.0.2" ,
38
+ "standard-version" : " ^2.4.0" ,
39
+ "travis-after-all" : " ^1.4.4"
38
40
},
39
41
"scripts" : {
40
42
"create-index" : " create-index --update-index ./src/utilities" ,
You can’t perform that action at this time.
0 commit comments