File tree Expand file tree Collapse file tree 5 files changed +79
-5
lines changed Expand file tree Collapse file tree 5 files changed +79
-5
lines changed Original file line number Diff line number Diff line change @@ -23,4 +23,6 @@ yarn-error.log*
23
23
.vscode
24
24
25
25
# build
26
- /build
26
+ /build
27
+
28
+ .env
Original file line number Diff line number Diff line change
1
+ tsconfig.json
2
+ tsconfig.test.json
3
+ tslint.json
4
+ .travis.yml
5
+ .npmignore
6
+ .package-lock.json
7
+ src /
8
+ samples /
9
+ config /
10
+ scripts /
Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
- - " 9"
4
- - " 8"
5
- - " 7"
3
+ - ' 9'
4
+ - ' 8'
5
+ - ' 7'
6
+
7
+ install :
8
+ - npm install
9
+
10
+ deploy :
11
+ - provider : script
12
+ skip_cleanup : true
13
+ script : .travis/pu.sh
14
+ on :
15
+ branch : master
16
+ tags : false
17
+ - provider : npm
18
+
19
+ api_key :
20
+ secure : $NPM_TOKEN
21
+ on :
22
+ tag : publish
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ setup_git () {
4
+ # Set the user name and email to match the API token holder
5
+ # This will make sure the git commits will have the correct photo
6
+ # and the user gets the credit for a checkin
7
+ git config --global user.email
" [email protected] "
8
+ git config --global user.name " liliankasem"
9
+ git config --global push.default matching
10
+
11
+ # Get the credentials from a file
12
+ git config credential.helper " store --file=.git/credentials"
13
+
14
+ # This associates the API Key with the account
15
+ echo " https://${GITHUB_API_KEY} :@github.com" > .git/credentials
16
+ }
17
+
18
+ make_version () {
19
+ # Make sure that the workspace is clean
20
+ # It could be "dirty" if
21
+ # 1. package-lock.json is not aligned with package.json
22
+ # 2. npm install is run
23
+ git checkout -- .
24
+
25
+ # Echo the status to the log so that we can see it is OK
26
+ git status
27
+
28
+ # Run the deploy build and increment the package versions
29
+ # %s is the placeholder for the created tag
30
+ npm version patch -m " chore: release version %s [skip ci]"
31
+ }
32
+
33
+ upload_files () {
34
+ # This make sure the current work area is pushed to the tip of the current branch
35
+ git push origin HEAD:$TRAVIS_BRANCH
36
+
37
+ # This pushes the new tag
38
+ git push --tags
39
+ }
40
+
41
+ setup_git
42
+ make_version
43
+ upload_files
Original file line number Diff line number Diff line change 84
84
"start" : " npm install && npm run build && npm --prefix ./sample run start" ,
85
85
"build" : " npm run lint && tsc" ,
86
86
"test" : " node scripts/test.js --env=jsdom" ,
87
- "prepublishOnly" : " npm run clean && npm install && npm run build"
87
+ "prepublishOnly" : " npm run clean && npm install && npm run build" ,
88
+ "version" : " npm run build && git add ." ,
89
+ "postversion" : " git push && git push --tags"
88
90
},
89
91
"devDependencies" : {
90
92
"@types/jest" : " ^22.2.3" ,
You can’t perform that action at this time.
0 commit comments